From 47f5fecdbe9fd29af83c150a26a29f3a1c3eb67b Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Fri, 21 Jul 2017 09:03:28 +0100 Subject: [PATCH] Fix examples object example and api-with-examples --- examples/v3.0/api-with-examples.yaml | 20 ++++++++++++-------- versions/3.0.md | 23 ++++++++++++++--------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/examples/v3.0/api-with-examples.yaml b/examples/v3.0/api-with-examples.yaml index ea0ce3f7dc..8fdee415ad 100644 --- a/examples/v3.0/api-with-examples.yaml +++ b/examples/v3.0/api-with-examples.yaml @@ -14,7 +14,8 @@ paths: content: application/json: examples: - - { + foo: + value: { "versions": [ { "status": "CURRENT", @@ -46,10 +47,11 @@ paths: content: application/json: examples: - - | - { + foo: + value: | + { "versions": [ - { + { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", @@ -72,7 +74,7 @@ paths: ] } ] - } + } /v2: get: operationId: getVersionDetailsv2 @@ -84,7 +86,8 @@ paths: content: application/json: examples: - - { + foo: + value: { "version": { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", @@ -128,7 +131,8 @@ paths: content: application/json: examples: - - { + foo: + value: { "version": { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", @@ -160,4 +164,4 @@ paths: } ] } - } \ No newline at end of file + } diff --git a/versions/3.0.md b/versions/3.0.md index 1ad353a2db..321aae3b89 100644 --- a/versions/3.0.md +++ b/versions/3.0.md @@ -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: @@ -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