-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Example #4730
Conversation
Working local examples are great to have!
The response 200 example will be rendered as:
|
Hi @Raptor399!
Note that only This is based on my reading of the OpenAPI Specification - let me know if you disagree. |
@shockey, so if I understand correctly the use of $ref - mentioned at the end of the Adding Examples documentation - should be covered in #2651? CC @Raptor399 |
@dafnalia, correct! |
@shockey, I understand that Example of what I'm trying to do:
The only uses of reusable examples I see in the spec is within
Thanks! |
@KaiserCoaster you're reading it correctly -
Yes - the current state of things is that we don't handle This will change soon, see #2651 (comment)! |
Description
This PR:
example
functionality to be OpenAPI 3-onlyexample
valuesMotivation and Context
Fixes #3437 - though that ticket mentions
examples
, which is not covered here, that item will live on in #2651.How Has This Been Tested?
Many e2e tests were added:
feature: `example` field support Swagger 2 primitive parameters ✓ should respect a primitive x-example value (4918ms) ✓ should ignore a primitive example value (1493ms) object parameters ✓ should correctly consider property-level schema examples (929ms) ✓ should correctly consider root schema-level schema examples (867ms) ✓ should correctly consider nested schema-level schema examples (817ms) responses ✓ should correctly consider schema-level examples (814ms) ✓ should correctly consider property-level examples (813ms) OpenAPI 3.0 parameters ✓ should respect a primitive example value (947ms) request bodies ✓ should correctly consider media type-level examples (870ms) ✓ should correctly consider schema-level examples (870ms) ✓ should correctly consider property-level examples (909ms) responses ✓ should correctly consider media type-level examples (815ms) ✓ should correctly consider schema-level examples (847ms) ✓ should correctly consider property-level examples (821ms)
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests