-
Notifications
You must be signed in to change notification settings - Fork 292
[openapi3] add support for parameter examples via @opExample #7403
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
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
This reverts commit 30a082d.
For reference link to inconclusive discussion on what is the correct way OAI/OpenAPI-Specification#4622 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, lets maybe make sure everyone is onboard with having it has this experimental flag vs just naming it parameter-examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets just do that and we can change the property later when we have more info
Fixes #3873
This PR adds support for generating parameter examples in openapi3.
Notes:
From the OpenAPI spec (https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-for-use-with-schema):
The parameter-level examples are meant to be serialized as they would appear over the wire. This means in some cases, they conflict with the parameter schema. For example, when a header parameter is an array.
The OpenAPI spec provides a table that shows what an example should look like for any given parameter style:
https://spec.openapis.org/oas/v3.0.4.html#style-examples
Link to inconclusive discussion on the correct way to represent example in OpenAPI 3 OAI/OpenAPI-Specification#4622