-
Notifications
You must be signed in to change notification settings - Fork 663
Add multiple nums[]
parameters support for GET /api/v1/crates/:name/versions
#10314
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
Conversation
We could also consider allowing |
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.
The functionality LGTM. 👍
We could also consider allowing
ids[]
to acceptid
orsemver
string (num
).
I think I'd prefer to keep those separate — while it's theoretically possible to distinguish integer IDs from semvers, it feels to me like it would be less surprising for users and future us if we didn't try to infer extra meaning from the provided values.
Which, given that, I'm not sure if ids[]
is the best name for the parameter, since ID feels like it more refers to versions.id
than versions.num
. Naming is hard, so I don't know what's better, but maybe num[]
or versions[]
might be clearer?
fair enough!
Given that we already responded with the field name @Turbo87 Any thoughts? |
it took me a while to figure this out, but it looks like the original reason for the the JSON:API spec (https://jsonapi.org/recommendations/#filtering) OTOH seems to recommend something like I agree with Adam that |
adf5ec2
to
689e3d1
Compare
…for `GET /api/v1/crates/:name/versions`
…tes/:name/versions`
689e3d1
to
285e483
Compare
GET /api/v1/crates/:id/versions
GET /api/v1/crates/:name/versions
GET /api/v1/crates/:name/versions
nums[]
parameters support for GET /api/v1/crates/:name/versions
Rebased and feedback addressed! |
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.
With that change, no concerns here. 👍
This allows us to return specified versions by filtering with the
ids[]
parameter.