Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open api/0.12 spec #369

Open
wants to merge 158 commits into
base: master
Choose a base branch
from
Open

Open api/0.12 spec #369

wants to merge 158 commits into from

Conversation

alecritson
Copy link
Contributor

This PR has various updates to the spec to get ready for 0.12

Notably I've added some initial include descriptions for resources, update some examples and update query params for some important routes.

commit 72fb73d
Author: Alec <hello@itsalec.co.uk>
Date:   Wed Dec 16 11:24:40 2020 +0000

    Add inGroup helper

commit e53eaee
Author: Alec <hello@itsalec.co.uk>
Date:   Wed Dec 16 11:23:51 2020 +0000

    Add sort to category resource

commit 2d67bca
Author: Alec <hello@itsalec.co.uk>
Date:   Sat Dec 12 14:58:53 2020 +0000

    Enable filtering by category on search

commit 8527f3e
Author: Dan Storm <storm@err0r.dk>
Date:   Mon Dec 14 09:55:39 2020 +0100

    Upgrade testsuite (#335)

commit 7118e67
Author: Glenn Jacobs <glenn@neondigital.co.uk>
Date:   Mon Nov 16 16:34:59 2020 +0000

    Feature/tidy openapi (#326)

    * Move password reset to Account tag in OpenAPI spec

commit e681748
Author: Glenn Jacobs <glenn@neondigital.co.uk>
Date:   Mon Nov 16 16:14:09 2020 +0000

    Feature/tidy openapi (#324)

    * Build full api spec file in GitHub Actions and remove from repo

    * Sort OpenAPI spec alphabetically

    * Apply fixes from StyleCI (#325)

    Co-authored-by: Glenn Jacobs <glennjacobs@users.noreply.github.com>

commit cfecb40
Author: Steve Hitchman <steve@builtbypxl.uk>
Date:   Mon Nov 16 10:18:40 2020 +0000

    Fix merge conflict

commit a3699fc
Merge: 0821123 5338f75
Author: Steve Hitchman <steve@builtbypxl.uk>
Date:   Mon Nov 16 10:12:19 2020 +0000

    Merge branch 'develop'

commit 0821123
Author: Alec <hello@itsalec.co.uk>
Date:   Thu Nov 12 07:57:51 2020 +0000

    Merge dev

commit 2ccc4c8
Author: Alec <hello@itsalec.co.uk>
Date:   Tue Nov 10 10:23:33 2020 +0000

    Fixes
alecritson and others added 11 commits March 18, 2021 09:47
* Refactor langauges

* Update changelog

* Fix indexing

* Apply fixes from StyleCI (#364)

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

* Adjust regex pattern

* Use proper values on factory

* rename $locale

* Update tests

* Remove unit group

* Adjust language change wording

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>
* Refactor langauges

* Update changelog

* Fix indexing

* Apply fixes from StyleCI (#364)

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

* Merge in 0.12

* Initial route refactoring

* Apply fixes from StyleCI (#365)

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

* Squashed commit of the following:

commit 71c15f7
Author: Alec <hello@itsalec.co.uk>
Date:   Thu Mar 18 15:07:05 2021 +0000

    Hotfix `lang` attribute reference

commit 9a601f7
Author: Alec <hello@itsalec.co.uk>
Date:   Thu Mar 18 15:06:50 2021 +0000

    Add phone email to mass assignment

commit aaaa441
Author: Alec <hello@itsalec.co.uk>
Date:   Thu Mar 18 10:06:56 2021 +0000

    Add keyword search to product families

commit 72a7399
Author: Alec <hello@itsalec.co.uk>
Date:   Thu Mar 18 10:06:46 2021 +0000

    Trigger indexable even when restoring

commit c831d92
Author: Alec Ritson <hello@itsalec.co.uk>
Date:   Thu Mar 18 09:47:34 2021 +0000

    Language Refactoring (#363)

    * Refactor langauges

    * Update changelog

    * Fix indexing

    * Apply fixes from StyleCI (#364)

    Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

    * Adjust regex pattern

    * Use proper values on factory

    * rename $locale

    * Update tests

    * Remove unit group

    * Adjust language change wording

    Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

* Apply fixes from StyleCI (#367)

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

* Make language id required

* Update to AliasResolver

* Update changelog

* Apply fixes from StyleCI (#368)

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>

* Styling update

* Styleci lint

* change from `language_id` to `language_code`

* Fix tests for unique constraint

Co-authored-by: Alec Ritson <alecritson@users.noreply.github.com>
@alecritson alecritson changed the base branch from master to release/0.12.0 March 22, 2021 13:46
Copy link
Contributor

@glennjacobs glennjacobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Need to ensure all examples are real-world (no "string" entries for example) and helpful.
  • When includes are available, we need to list what can be requested, e.g. product, category or whatever and include plenty of examples too. Eg. products with their variants.
  • Same for any other fields, we need to suggest what they're expecting - remove the guesswork.

Real example requests and responses will help loads in understanding the API.

Base automatically changed from release/0.12.0 to master March 23, 2021 13:31
@glennjacobs
Copy link
Contributor

Also worth noting we do not have any spec for the recycle bin restore function.

@glennjacobs
Copy link
Contributor

Channels

GET /channels

{
  "data": [
    {
      "id": "y3g6v91o",
      "name": "Webstore",
      "handle": "webstore",
      "url": "localhost:8080",
      "default": true
    }
  ],
  "meta": {
    "current_page": 1,
    "from": 24,
    "last_page": 15,
    "path": "string",
    "per_page": 1,
    "to": 0,
    "total": 0,
    "links": [
      {
        "url": "string",
        "label": "string",
        "active": true
      }
    ]
  }
}

Need to replace the "string" entries with something meaningful.

POST + PUT /channels

Missing example request.

GET /channels/{channelId}

Example request in PHP not JSON.

@glennjacobs
Copy link
Contributor

{
  "data": [
    {
      "id": "y3g6v91o",
      "name": "Webstore",
      "handle": "webstore",
      "url": "localhost:8080",
      "default": true
    }
  ],
  "meta": {
    "current_page": 1,
    "from": 24,
    "last_page": 15,
    "path": "http:\\/\\/api.test\\/api\\/v1\\/channels",
    "per_page": 1,
    "to": 0,
    "total": 0,
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "active": false
      },
      {
        "url": "http://api.test/api/v1/channels?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "active": false
      }
    ]
  }
}

URLs are showing in two different formats?

Random import removed, as it's not needed
@glennjacobs glennjacobs removed their request for review February 9, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants