-
Notifications
You must be signed in to change notification settings - Fork 9
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
OpenApi docs/specs #11
Comments
It would certanily be nice if the options to combine existing filters with and, or and not would be displayed in the OpenApi docs! I was led to believe that the OpenApi docs only support a flat list of keys that activate the filters and types of the values that can be passed to them. But i must admit, i did not really look into it. So maybe OpenApi supports more and can actually express the combination of the existing filters woth and, or and not in a tree of indefinite depth. If you have an idea about how to do that, please explain! Or maybe a flat list of a configurable number of layers combined with the specs of each of the existing filters would do? But if there are many filters, wouldn't that lead to a very long list? How to keep that within usable limits? |
We translate the schema to typescript types using https://www.npmjs.com/package/openapi-typescript. For that purpose a wildcard for any additional "and", "or" and "not" would be sufficient for the beginning. Like that the consuming client knows after the FilterLogic filter possibilities. Something in this direction : openapi-ts/openapi-typescript@f9229a2#diff-0865c2993ba1a2e26419456a46efc98132e5afdffe4028442d17945ba7c19826R21 For that purpose i think we need to describe the and, or and not as query parameters: https://swagger.io/docs/specification/describing-parameters/ The open api spec in 3.0 at least describes this "additional properties" here: Another solution would be to add "valid" open api exposed filters based on allowed filters on the api resource using FilterLogic.
Would perhaps need to settle on one way how to apply these filters not not allow arbitrary combinations. |
Hi, I do not have the time right now to look into it. Ik hope next week is less busy so that i can take a look. Thanks for now, Henk. |
Flattening out the combinations of logic and filters, like you do under I do not understand what you mean by a wildcard, a description like Reading swagger.io/docs my best guess would be the following:
Objects additionalProperties by default is true, but i am not sure type "object" itself would be valid.
Or one could make the type specific to the entity and its filters. For example the
But i am not sure these are valid docs and even then they do not cover multiple criteria for the same property like this:
I would not know how to document this with openapi. |
The filters are not displayed in the OpenApi docs. I would still find it a useful extension. What do you think?
The text was updated successfully, but these errors were encountered: