Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions examples/v3.0/api-with-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ paths:
content:
application/json:
examples:
- {
foo:
value: {
"versions": [
{
"status": "CURRENT",
Expand Down Expand Up @@ -46,10 +47,11 @@ paths:
content:
application/json:
examples:
- |
{
foo:
value: |
{
"versions": [
{
{
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"id": "v2.0",
Expand All @@ -72,7 +74,7 @@ paths:
]
}
]
}
}
/v2:
get:
operationId: getVersionDetailsv2
Expand All @@ -84,7 +86,8 @@ paths:
content:
application/json:
examples:
- {
foo:
value: {
"version": {
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
Expand Down Expand Up @@ -128,7 +131,8 @@ paths:
content:
application/json:
examples:
- {
foo:
value: {
"version": {
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
Expand Down Expand Up @@ -160,4 +164,4 @@ paths:
}
]
}
}
}
23 changes: 14 additions & 9 deletions versions/3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2205,21 +2205,25 @@ schemas:
example:
$ref: http://foo.bar#/examples/name-example

# in a request body, note the plural `examples` as the Content-Type is set to `*`:
# in a request body, note the plural `examples`
requestBody:
content:
'application/json':
schema:
$ref: '#/components/schemas/Address'
examples:
- {"foo": "bar"}
- {"bar": "baz"}
examples:
foo:
value: {"foo": "bar"}
bar:
value: {"bar": "baz"}
'application/xml':
examples:
- $ref: 'http://foo.bar#/examples/address-example.xml'
examples:
xml:
externalValue: 'http://foo.bar/examples/address-example.xml'
'text/plain':
examples:
- $ref: 'http://foo.bar#/examples/address-example.txt'
examples:
text:
externalValue: 'http://foo.bar/examples/address-example.txt'

# in a parameter
parameters:
Expand All @@ -2230,7 +2234,8 @@ schemas:
format: 'zip-code'
example:
$ref: 'http://foo.bar#/examples/zip-example'
# in a response, note the plural `examples`:

# in a response, note the singular `example`:
responses:
'200':
description: your car appointment has been booked
Expand Down