Skip to content

Commit 337c3c0

Browse files
authored
Merge pull request #907 from OAI/dm/issue-906
Fixes for Example object #906
2 parents 529548a + 007d163 commit 337c3c0

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

versions/3.0.md

+14-20
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,8 @@ Field Name | Type | Description
761761
<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`.
762762
<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`.
763763
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter.
764-
<a name="parameterExamples"></a>examples | [Examples Array](#examplesArray) | Examples of the content type. Each example in the Examples Array MUST 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 will _override_ the example provided by the schema.
765-
<a name="parameterExample"></a>example | [Example Object](#exampleObject) | Example of the content type. The example object MUST 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 will _override_ the example provided by the the schema.
764+
<a name="parameterExamples"></a>examples | [[Example Object](#exampleObject)] | 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.
765+
<a name="parameterExample"></a>example | [Example Object](#exampleObject) | 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.
766766

767767
For more complex scenarios a `content` object can be used to define the media-type
768768
and schema of the parameter. This option is mutually exclusive with the simple scenario
@@ -1089,8 +1089,8 @@ Each content type object provides schema and examples for a the media type ident
10891089
Field Name | Type | Description
10901090
---|:---:|---
10911091
<a name="contentTypeSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the request body.
1092-
<a name="contentTypeExamples"></a>examples | [Examples Array](#examplesArray) | Examples of the content type. Each example in the Examples Array must be in the correct format as specified in the _content_ type. The `examples` object is mutually exclusive to the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value will _override_ the example provided by the schema.
1093-
<a name="contentTypeExample"></a>example | [Example Object](#exampleObject) | Example of the content type. The example object SHOULD be in the correct format as specified in the _content_ type. The `example` object is mutually exclusive to the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value will _override_ the the example provided by the schema.
1092+
<a name="contentTypeExamples"></a>examples | [Examples Array](#examplesArray) | Examples of the content type. Each example in the Examples array SHOULD be in the correct format as specified in the _content_ 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.
1093+
<a name="contentTypeExample"></a>example | [Example Object](#exampleObject) | Example of the content type. The example object SHOULD be in the correct format as specified in the _content_ 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.
10941094

10951095
##### Patterned Fields
10961096
Field Pattern | Type | Description
@@ -1642,38 +1642,32 @@ X-Rate-Limit-Reset:
16421642
type: integer
16431643
```
16441644

1645-
#### <a name="examplesObject"></a>Examples Object
1646-
1647-
Allows sharing examples for operation requests and responses.
1645+
#### <a name="exampleObject"></a>Example Object
16481646

1649-
##### Patterned Fields
1650-
Field Pattern | Type | Description
1651-
---|:---:|---
1652-
<a name="exampleMediaType"></a>{[media type](#mediaTypes)} | Any | The name of the property MUST be one of the Operation `produces` values (either implicit or inherited). The value SHOULD be an example of what such a response would look like.
1647+
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.
16531648

1654-
##### Examples Array Example
1649+
##### Example Example
16551650

16561651
Example representation for application/json media type of a Pet data type:
16571652

16581653
```json
1659-
[
16601654
{
16611655
"name": "Puma",
16621656
"type": "Dog",
16631657
"color": "Black",
16641658
"gender": "Female",
16651659
"breed": "Mixed"
16661660
}
1667-
]
16681661
```
16691662

16701663
```yaml
1671-
-
1672-
name: Puma
1673-
type: Dog
1674-
color: Black
1675-
gender: Female
1676-
breed: Mixed
1664+
1665+
name: Puma
1666+
type: Dog
1667+
color: Black
1668+
gender: Female
1669+
breed: Mixed
1670+
16771671
```
16781672

16791673
#### <a name="linksObject"></a>Links Object

0 commit comments

Comments
 (0)