Apicurio/apicurio-registry

REST API /search/versions query parameter order matters

Closed this issue · 2 comments

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

This now works as intended in 3.0.0.M5

Thank you for following up and closing this. 👍