-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve how LookupArgumentSets are defined #4
Comments
Jim also left a comment about this here: https://github.com/krystal/katapult/issues/2050#issuecomment-1801829013 |
Whilst looking at this we should implement if the query param is required or not. |
OK I dug into this some more and the openapi 3.0 spec actually admits that it cannot describe inter-dependant params. https://swagger.io/docs/specification/describing-parameters/#dependencies
There's an issue about it here: OAI/OpenAPI-Specification#256 They suggest returning a 400 with an error explaining it. Which is what Apia already does...
We could update the description of the params, to at least explain that only one param is expected. |
OpenAPI 3.0 does not support parameter dependencies and mutually exclusive parameters. https://swagger.io/docs/specification/describing-parameters/#dependencies This is a complex topic with a lot of debate: OAI/OpenAPI-Specification#256 We know that our LookupArgumentSets are mutually exclusive, so the best thing is to add a description explaining this, so that it will appear in documentation and tools like the swagger editor. Apia already returns a 400 with a friendly error message. closes: #4
OpenAPI 3.0 does not support parameter dependencies and mutually exclusive parameters. https://swagger.io/docs/specification/describing-parameters/#dependencies This is a complex topic with a lot of debate: OAI/OpenAPI-Specification#256 We know that our LookupArgumentSets are mutually exclusive, so the best thing is to add a description explaining this, so that it will appear in documentation and tools like the swagger editor. Apia already returns a 400 with a friendly error message. closes: #4
We should take a look and see if we can improve how
LookupArgumentSet
s are declared in the spec – currently swagger-editor allows both params (e.g. id and permalink) to be sent in the request which triggers an error in Apia.We should take a look at using a discriminator object such as
oneOf
which I think should allow us to specify that either the id is sent or the permalink is sent. But not both.The text was updated successfully, but these errors were encountered: