You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2022. It is now read-only.
@@ -49,12 +49,12 @@ Additional utilities can also take advantage of the resulting files, such as tes
49
49
- [Response Object](#responseObject)
50
50
- [Headers Object](#headersObject)
51
51
- [Example Object](#exampleObject)
52
+
- [Described Example Object](#describedExampleObject)
52
53
- [Links Object](#linksObject)
53
54
- [Link Object](#linkObject)
54
55
- [Link Parameters Object](#linkParametersObject)
55
56
- [Header Object](#headerObject)
56
57
- [Tag Object](#tagObject)
57
-
- [Examples Object](#examplesObject)
58
58
- [Reference Object](#referenceObject)
59
59
- [Schema Object](#schemaObject)
60
60
- [XML Object](#xmlObject)
@@ -402,7 +402,7 @@ Field Name | Type | Description
402
402
<a name="componentsSchemas"></a> schemas | Map[`string`, [Schema Object](#schemaObject)] | An object to hold reusable [Schema Objects](#schemaObject).
403
403
<a name="componentsResponses"></a> responses | Map[`string`, [Response Object](#responseObject)] | An object to hold reusable [Response Objects](#responseObject).
404
404
<a name="componentsParameters"></a> parameters | Map[`string`, [Parameter Object](#parameterObject)] | An object to hold reusable [Parameter Objects](#parameterObject).
405
-
<a name="componentsExamples"></a> examples | Map[`string`, [Example Object](#exampleObject)] | An object to hold reusable [Example Objects](#exampleObject).
405
+
<a name="componentsExamples"></a> examples | Map[`string`, [Described Example Object](#describedExampleObject)] | An object to hold reusable [Described Example Objects](#describedExampleObject).
406
406
<a name="componentsRequestBodies"></a> requestBodies | Map[`string`, [Request Body Object](#requestBodyObject)] | An object to hold reusable [Request Body Objects](#requestBodyObject).
407
407
<a name="componentsHeaders"></a> headers | Map[`string`, [Header object](#headerObject)] | An object to hold reusable [Header objects](#headerObject).
408
408
<a name="componentsSecuritySchemes"></a> securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject).
@@ -932,8 +932,8 @@ Field Name | Type | Description
932
932
<a name="parameterExplode"></a>explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of parameters this property has no effect. When [`style`](#parameterStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
933
933
<a name="parameterAllowReserved"></a>allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
934
934
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) <span>|</span> [Reference Object](#referenceObject)] | The schema defining the type used for the parameter.
935
-
<a name="parameterExamples"></a>examples | [[Example Object](#exampleObject) <span>|</span> [Reference Object](#referenceObject)] | Examples of the content type. Each example in the Examples array SHOULD be in the correct format as specified parameter encoding. The `examples` object is mutually exclusive to the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
936
-
<a name="parameterExample"></a>example | [Example Object](#exampleObject) <span>|</span> [Reference Object](#referenceObject) | Example of the content type. The example object SHOULD be in the correct format as specified in the parameter encoding. The `example` object is mutually exclusive to the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the the schema.
935
+
<a name="parameterExample"></a>example | [Example Object](#exampleObject) | Example of the media type. The example object SHOULD be in the correct format as specified in the parameter encoding. The `example` object is mutually exclusive to the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the the example provided by the schema.
936
+
<a name="parameterExamples"></a>examples | Map[ `string`, [Described Example Object](#describedExampleObject) <span>|</span> [Reference Object](#referenceObject)] | Described Examples of the media type. Each described example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` object is mutually exclusive to the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
937
937
938
938
For more complex scenarios a [Content Object](#contentObject) can be used to define the media type
939
939
and schema of the parameter. This option is mutually exclusive with the simple scenario
@@ -1258,9 +1258,9 @@ Each Media Type Object provides schema and examples for a the media type identif
1258
1258
##### Fixed Fields
1259
1259
Field Name | Type | Description
1260
1260
---|:---:|---
1261
-
<a name="mediaTypeSchema"></a>schema | [Schema Object](#schemaObject) <span>|</span> [Reference Object](#referenceObject)] | The schema defining the type used for the request body.
1262
-
<a name="mediaTypeExamples"></a>examples | [[Example Object](#exampleObject) <span>|</span> [Reference Object](#referenceObject)] | Examples of the media type. Each example in the Examples array SHOULD be in the correct format as specified in the media type. The `examples` object is mutually exclusive to the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
1263
-
<a name="mediaTypeExample"></a>example | [Example Object](#exampleObject) <span>|</span> [Reference Object](#referenceObject) | Example of the media type. The example object SHOULD be in the correct format as specified in the media type. The `example` object is mutually exclusive to the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the the example provided by the schema.
1261
+
<a name="mediaTypeSchema"></a>schema | [Schema Object](#schemaObject) <span>|</span> [Reference Object](#referenceObject) | The schema defining the type used for the request body.
1262
+
<a name="mediaTypeExample"></a>example | [Example Object](#exampleObject) | Example of the media type. The example object SHOULD be in the correct format as specified in the media type. The `example` object is mutually exclusive to the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the the example provided by the schema.
1263
+
<a name="mediaTypeExamples"></a>examples | Map[ `string`, [Described Example Object](#describedExampleObject) <span>|</span> [Reference Object](#referenceObject)] | Described Examples of the media type. Each described example SHOULD contain a value in the correct format as specified in the media type. The `examples` object is mutually exclusive to the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
1264
1264
<a name="mediaTypeEncoding"></a>encoding | [Encoding Object](#encodingObject) | Encoding of the media type. The encoding object SHOULD only apply to `requestBody` objects when the content type is `multipart`.
1265
1265
1266
1266
This object can be extended with [Specification Extensions](#specificationExtensions).
@@ -1273,14 +1273,23 @@ This object can be extended with [Specification Extensions](#specificationExtens
1273
1273
"schema": {
1274
1274
"$ref": "#/components/schemas/Pet"
1275
1275
},
1276
-
"examples": [{
1277
-
"name": "Fluffy",
1278
-
"petType": "Cat"
1279
-
},
1280
-
{
1281
-
"name": "Rover",
1282
-
"petType": "Frog"
1283
-
}]
1276
+
"examples": {
1277
+
"cat" : {
1278
+
"summary": "An example of a cat",
1279
+
"value":
1280
+
{
1281
+
"name": "Fluffy",
1282
+
"petType": "Cat"
1283
+
}
1284
+
},
1285
+
"frog": {
1286
+
"summary": "An example of a frog with a dog's name",
1287
+
"value" : {
1288
+
"name": "Rover",
1289
+
"petType": "Frog"
1290
+
}
1291
+
}
1292
+
}
1284
1293
}
1285
1294
}
1286
1295
```
@@ -1290,11 +1299,18 @@ application/json:
1290
1299
schema:
1291
1300
$ref: "#/components/schemas/Pet"
1292
1301
examples:
1293
-
# converted directly from YAML to JSON
1294
-
- name: Fluffy
1295
-
petType: Cat
1296
-
- {"name": "Rover", "petType": "Frog"}
1297
-
1302
+
cat:
1303
+
summary: An example of a cat
1304
+
value:
1305
+
name: Fluffy
1306
+
petType: Cat
1307
+
frog:
1308
+
summary: An example of a frog with a dog's name
1309
+
value:
1310
+
name: Rover
1311
+
petType: Frog
1312
+
dog:
1313
+
$ref: "#/components/examples/dog-example"
1298
1314
```
1299
1315
1300
1316
##### Considerations for file uploads
@@ -1813,7 +1829,7 @@ X-Rate-Limit-Reset:
1813
1829
1814
1830
#### <a name="exampleObject"></a>Example Object
1815
1831
1816
-
Allows sharing examples for operation requests and responses. This object can either be a freeform object, array or primitive value. To represent examples of media types that cannot naturally represented in the OpenAPI definition, a string value can be used to contain the example with escaping where necessary.
1832
+
Allows sharing examples for operation requests and responses. This literal value can either be any JSON or YAML object, array or primitive value. To represent examples of media types that cannot naturally represented in the OpenAPI definition, a string value can be used to contain the example with escaping where necessary.
1817
1833
1818
1834
##### Example Example
1819
1835
@@ -1839,6 +1855,82 @@ breed: Mixed
1839
1855
1840
1856
```
1841
1857
1858
+
#### <a name="describedExampleObject"></a>Described Example Object
1859
+
1860
+
##### Fixed Fields
1861
+
Field Name | Type | Description
1862
+
---|:---:|---
1863
+
<a name="describedExampleSummary"></a>summary | `string` | Short description for the example.
1864
+
<a name="describedExampleDescription"></a>description | `string` | Long description for the example.
1865
+
<a name="describedExampleValue"></a>value | [Example Object](#exampleObject) | Embedded literal example. The `value` field and `valueUrl` field are mutually exclusive.
1866
+
<a name="describedExampleValueUrl"></a>valueUrl | `string` | A Url that points to the literal example. This provides the ability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `valueUrl` field are mutually exclusive.
1867
+
1868
+
This object can be extended with [Specification Extensions](#specificationExtensions).
1869
+
1870
+
In all cases, the example value is expected to be compatible with the type schema
1871
+
for the value that it is accompanying. Tooling implementations MAY choose to
1872
+
validate compatibility automatically, and reject the example value(s) if they
The links object represents a set of possible design-time links for a response.
1844
1936
The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
@@ -2344,64 +2436,6 @@ name: pet
2344
2436
description: Pets operations
2345
2437
```
2346
2438
2347
-
#### <a name="examplesObject"></a>Examples Object
2348
-
2349
-
Anywhere an `example` may be given, a JSON Reference MAY be used, with the
2350
-
explicit restriction that examples having a JSON format with object named
2351
-
`$ref`are not allowed. This does mean that `example`, structurally, can be
2352
-
either a string primitive or an object, similar to `additionalProperties`.
2353
-
2354
-
In all cases, the payload is expected to be compatible with the type schema
2355
-
for the value that it is accompanying. Tooling implementations MAY choose to
2356
-
validate compatibility automatically, and reject the example value(s) if they
2357
-
are not compatible.
2358
-
2359
-
```yaml
2360
-
# in a model
2361
-
schemas:
2362
-
properties:
2363
-
name:
2364
-
type: string
2365
-
example:
2366
-
$ref: http://foo.bar#/examples/name-example
2367
-
2368
-
# in a request body, note the plural `examples` as the Content-Type is set to `*`:
@@ -2509,7 +2543,6 @@ Field Name | Type | Description
2509
2543
<a name="schemaXml"></a>xml | [XML Object](#xmlObject) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.
2510
2544
<a name="schemaExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
2511
2545
<a name="schemaExample"></a>example | Any | A free-form property to include an example of an instance for this schema.
2512
-
<a name="schemaExamples"></a>examples | Any | An array of free-formed properties to include examples for this schema.
2513
2546
<a name="schemaDeprecated"></a> deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage.
2514
2547
2515
2548
This object can be extended with [Specification Extensions](#specificationExtensions).
0 commit comments