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

Raise an error if both name and purl are provided. #1451

Closed
oliverchang opened this issue Jul 7, 2023 · 0 comments · Fixed by #1652
Closed

Raise an error if both name and purl are provided. #1451

oliverchang opened this issue Jul 7, 2023 · 0 comments · Fixed by #1652
Labels
api API-related infrastructure good first issue Good for newcomers

Comments

@oliverchang
Copy link
Collaborator

oliverchang commented Jul 7, 2023

Currently we return an error if both ecosystem and purl are provided in a query. We should make things consistent with name as well. Context: #1443 (comment).

This also extends a little to version -- if a PURL includes a version and an explicit version parameter is provided as well, that should also be an error.

@oliverchang oliverchang added the api API-related infrastructure label Jul 7, 2023
@andrewpollock andrewpollock added the good first issue Good for newcomers label Jul 10, 2023
andrewpollock added a commit that referenced this issue Oct 6, 2023
Closes #1451

I've added some validations for when the query contains both a
`package.purl` and a `package.name`, and when the `package.purl`
contains a version and there is a redundant `version` included in the
query. In both cases, we're raising a 400 with an error message. Also
I've moved the `ecosystem` validation into `do_query` to keep all the
validations in one place.

---------

Co-authored-by: Andrew Pollock <andrewpollock@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API-related infrastructure good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants