-
Notifications
You must be signed in to change notification settings - Fork 292
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
Bug: The examples
keyword from OpenAPI 3.1.0 is ignored in some places
#1067
Comments
thanks i will take a look soon. Can you tell me how does it work when you provide multiple examples ? the spec contains only one example in the |
Thanks! I just got back from a winter break, myself.
It would be nice to support multiple examples. However, neither SwaggerEditor nor RapiDoc (even with #1065) supports multiple examples. The minimal spec I provided above includes: "string_field": {
"description": "String Field",
"examples": ["Included in output", "Missing from output since only one example is displayed"],
"type": "string"
} Note the second element of the array there. Prior to #1065, RapiDoc and SwaggerEditor both display #1065 only addresses the problem that the I have noticed that RapiDoc sometimes displays multiple examples, but only in situations with |
In OpenAPI 3.1.0, the
example
schema keyword is deprecated in favor of theexamples
keyword from JSON Schema. RapiDoc ignores theexamples
keyword in some contexts, which causes it to omit schema-provided examples from its output entirely in some cases, unless they are provided via the deprecated keyword.NOTE: I've created a PR to address this problem here: #1065
Reproduction and Impact
openapi-spec-minimal.json
(included at the end of this issue) via the "LOCAL JSON FILE" button at https://rapidocweb.com/examples/example1.htmlPOST /api/test
EXAMPLE
in theRESPONSE
sectionActual behavior:
Note
[ "string" ]
underlist_field
.Expected behavior:
Note
[ "Bug: missing from output" ]
underlist_field
.Note that this expected behavior is also present when using https://editor-next.swagger.io/
Minimal Schema
openapi-spec-minimal.json
:Note that this schema validates using https://editor-next.swagger.io/, but the
example
field is shown as deprecated, as expected.The text was updated successfully, but these errors were encountered: