-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add routes for resolving items by refcode #807
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #807 +/- ##
==========================================
+ Coverage 67.26% 67.33% +0.06%
==========================================
Files 62 62
Lines 3858 3869 +11
==========================================
+ Hits 2595 2605 +10
- Misses 1263 1264 +1
|
706c0b8
to
5250762
Compare
Test summaryRun details
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud |
f99d6d2
to
bb75f2d
Compare
154c77b
to
847a20e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great !
847a20e
to
fdecf81
Compare
fdecf81
to
8828987
Compare
First steps on #803
This PR adds/items/by-refcode/<refcode>
and/items/by-id/<id>
endpoints that essentially replace/get_item_data/<item_id>
. I'm not entirely happy with the routes yet, and would like to find some examples of how other APIs deal with what are essentially multiple canonical IDs. Havingby-id
andby-refcode
feels natural, but perhaps simply/items/refcode/<refcode>
is more extensible and compatible with e.g. JSON:API to other fields in the future.Went with this in the end: having
/items/<refcode>
be the canonical URL is appealing, with the "legacy" endpoint being the only way to refer to items by item ID -- this would also allow us to promote refcode at some point to simply be the top-levelid
field in JSON:API parlance, which has some nice properties.