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

REST API /search/versions query parameter order matters #4930

Closed
wolfchimneyrock opened this issue Jul 25, 2024 · 2 comments
Closed

REST API /search/versions query parameter order matters #4930

wolfchimneyrock opened this issue Jul 25, 2024 · 2 comments

Comments

@wolfchimneyrock
Copy link
Contributor

wolfchimneyrock commented Jul 25, 2024

query parameters when searching for versions seems to matter, and different results are returned depending on their order.

Description

Registry
Version
: 3.0.0.M3
Persistence type: sql / postgresql

Steps to Reproduce

canonical vs artifactType order:

curl -X POST --data @payload.json http://localhost:8080/apis/registry/v3/search/versions?canonical=true&artifactType=JSON

groupId vs artifactId order

curl http://localhost:8080/apis/registry/v3/search/versions?groupId=foo&artifactId=bar

Expected vs Actual Behaviour

if artifactType parameter is set before canonical=true, then the expected result returns.

if canonical parameter is set before artifactType, then status 400 is returned with message When setting 'canonical' to 'true', the 'artifactType' query parameter is also required

if artifactId parameter is set before groupId parameter, then the expected versions are returned.

if groupId parameter is set before artifactId parameter, then all versions in the group are returned (instead of ones matching both the group and artifact)

Logs

no interesting log output

@wolfchimneyrock
Copy link
Contributor Author

This now works as intended in 3.0.0.M5

@EricWittmann
Copy link
Member

Thank you for following up and closing this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants