Skip to content
This repository was archived by the owner on May 30, 2022. It is now read-only.

Commit 8b4437e

Browse files
committed
Updates based on PR Comments
1 parent c094380 commit 8b4437e

File tree

1 file changed

+30
-75
lines changed

1 file changed

+30
-75
lines changed

versions/3.0.md

Lines changed: 30 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ Field Name | Type | Description
937937
<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`.
938938
<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`.
939939
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) \| [Reference Object](#referenceObject)] | The schema defining the type used for the parameter.
940-
<a name="parameterExample"></a>example | Any | 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. To represent examples of media types that cannot naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
940+
<a name="parameterExample"></a>example | Any | Example of the media type. The example SHOULD match the specified schema and encoding properties if present. 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. To represent examples of media types that cannot naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
941941
<a name="parameterExamples"></a>examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each 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.
942942

943943
For more complex scenarios a [Content Object](#contentObject) can be used to define the media type
@@ -1324,7 +1324,7 @@ Field Name | Type | Description
13241324
---|:---:|---
13251325
<a name="mediaTypeSchema"></a>schema | [Schema Object](#schemaObject) \| [Reference Object](#referenceObject) | The schema defining the type used for the request body.
13261326
<a name="mediaTypeExample"></a>example | Any | 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.
1327-
<a name="mediaTypeExamples"></a>examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each example object 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.
1327+
<a name="mediaTypeExamples"></a>examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. 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.
13281328
<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`.
13291329

13301330
This object can be extended with [Specification Extensions](#specificationExtensions).
@@ -1343,14 +1343,23 @@ This object can be extended with [Specification Extensions](#specificationExtens
13431343
"value":
13441344
{
13451345
"name": "Fluffy",
1346-
"petType": "Cat"
1346+
"petType": "Cat",
1347+
"color": "White",
1348+
"gender": "male",
1349+
"breed": "Persian"
13471350
}
13481351
},
1349-
"frog": {
1350-
"summary": "An example of a frog with a dog's name",
1352+
"dog": {
1353+
"summary": "An example of a dog with a cat's name",
13511354
"value" : {
1352-
"name": "Rover",
1353-
"petType": "Frog"
1355+
"name": "Puma",
1356+
"petType": "Dog",
1357+
"color": "Black",
1358+
"gender": "Female",
1359+
"breed": "Mixed"
1360+
},
1361+
"frog": {
1362+
"$ref": "#/components/examples/frog-example"
13541363
}
13551364
}
13561365
}
@@ -1368,13 +1377,19 @@ application/json:
13681377
value:
13691378
name: Fluffy
13701379
petType: Cat
1371-
frog:
1372-
summary: An example of a frog with a dog's name
1373-
value:
1374-
name: Rover
1375-
petType: Frog
1380+
color: White
1381+
gender: male
1382+
breed: Persian
13761383
dog:
1377-
$ref: "#/components/examples/dog-example"
1384+
summary: An example of a dog with a cat's name
1385+
value:
1386+
name: Puma
1387+
petType: Dog
1388+
color: Black
1389+
gender: Female
1390+
breed: Mixed
1391+
frog:
1392+
$ref: "#/components/examples/frog-example"
13781393
```
13791394

13801395
##### Considerations for file uploads
@@ -1918,9 +1933,9 @@ schemas:
19181933
type: string
19191934
examples:
19201935
name:
1921-
$ref: http://example.org/petapi-examples/OpenApi.json#/components/examples/name-example
1936+
$ref: http://example.org/petapi-examples/openapi.json#/components/examples/name-example
19221937
1923-
# in a request body, note the plural `examples` as the Content-Type is set to `*`:
1938+
# in a request body:
19241939
requestBody:
19251940
content:
19261941
'application/json':
@@ -2532,7 +2547,6 @@ schemas:
25322547
$ref: http://foo.bar#/examples/address-example.json
25332548
```
25342549
2535-
>>>>>>> refs/remotes/origin/OpenAPI.next
25362550
#### <a name="referenceObject"></a>Reference Object
25372551
25382552
A simple object to allow referencing other components in the specification, internally and externally.
@@ -2792,65 +2806,6 @@ example:
27922806
id: 1
27932807
```
27942808

2795-
###### Model with Examples
2796-
2797-
```json
2798-
{
2799-
"type": "object",
2800-
"properties": {
2801-
"id": {
2802-
"type": "integer",
2803-
"format": "int64"
2804-
},
2805-
"name": {
2806-
"type": "string"
2807-
}
2808-
},
2809-
"required": [
2810-
"name"
2811-
],
2812-
"examples": {
2813-
"cat": {
2814-
"summary": "Big cat example",
2815-
"value": {
2816-
"name": "Puma",
2817-
"id": 1
2818-
}
2819-
},
2820-
"dog": {
2821-
"summary": "Family dog example",
2822-
"value": {
2823-
"name": "Ferguson",
2824-
"id": 2
2825-
}
2826-
}
2827-
}
2828-
}
2829-
```
2830-
2831-
```yaml
2832-
type: object
2833-
properties:
2834-
id:
2835-
type: integer
2836-
format: int64
2837-
name:
2838-
type: string
2839-
required:
2840-
- name
2841-
examples:
2842-
cat:
2843-
summary: Big cat example
2844-
value:
2845-
name: Puma
2846-
id: 1
2847-
dog:
2848-
summary: Family Dog
2849-
value:
2850-
name: Ferguson
2851-
id: 2
2852-
```
2853-
28542809
###### Models with Composition
28552810

28562811
```json

0 commit comments

Comments
 (0)