Contradiction between Swagger Documentation and practical use of 'default' in query parameters #5133
Unanswered
fabio-resende
asked this question in
Q&A
Replies: 1 comment
-
The only official OpenAPI documentation is spec.openapis.com and learn.openapis.com. We are not responsible for Swagger, Swagger UI, or the contents of the Swagger web site. The spec defines what is correct. Anything else a tool does is a problem to take up with the tooling vendor. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
According to the official Swagger/OpenAPI documentation:
However, in practice, when we add default to a required parameter, Swagger tools (UI and code generators) use that value to:
On the other hand, if we do not set a default, even for required parameters, the generated URL in samples omits the parameter, and the Try it out field remains empty, which often causes errors during testing.
This creates a contradiction:
Questions:
Is there an official recommendation to handle this inconsistency?
Are there plans for Swagger UI to use example (or examples) for auto-filling required fields instead of relying on default?
What is considered best practice to maintain semantic correctness while providing a good user experience?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions