Skip to content

Commit f77f7f5

Browse files
Phil SturgeonMikeRalphson
Phil Sturgeon
authored andcommitted
The examples keyword is not supported inside schema (OAI#2042)
* examples not supported inside schema * figured it out * a tiny little edit Signed-off-by: Mike Ralphson <[email protected]>
1 parent 996c413 commit f77f7f5

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

versions/3.1.0.md

+7-19
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,11 @@ For simpler scenarios, a [`schema`](#parameterSchema) and [`style`](#parameterSt
10311031
Field Name | Type | Description
10321032
---|:---:|---
10331033
<a name="parameterStyle"></a>style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
1034-
<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`.
1034+
<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`.
10351035
<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`.
10361036
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter.
1037-
<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` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
1038-
<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` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
1037+
<a name="parameterExample"></a>example | Any | Example of the parameter's potential value. The example SHOULD match the specified schema and encoding properties if present. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` that contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
1038+
<a name="parameterExamples"></a>examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` that contains an example, the `examples` value SHALL _override_ the example provided by the schema.
10391039

10401040
For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
10411041
A parameter MUST contain either a `schema` property, or a `content` property, but not both.
@@ -1044,7 +1044,7 @@ When `example` or `examples` are provided in conjunction with the `schema` objec
10441044

10451045
Field Name | Type | Description
10461046
---|:---:|---
1047-
<a name="parameterContent"></a>content | Map[`string`, [Media Type Object](#mediaTypeObject)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
1047+
<a name="parameterContent"></a>content | Map[`string`, [Media Type Object](#mediaTypeObject)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
10481048

10491049
##### Style Values
10501050

@@ -1955,18 +1955,6 @@ validate compatibility automatically, and reject the example value(s) if incompa
19551955

19561956
##### Example Object Examples
19571957

1958-
In a model:
1959-
1960-
```yaml
1961-
schemas:
1962-
properties:
1963-
name:
1964-
type: string
1965-
examples:
1966-
name:
1967-
$ref: https://example.org/petapi-examples/openapi.json#/components/examples/name-example
1968-
```
1969-
19701958
In a request body:
19711959

19721960
```yaml
@@ -2003,9 +1991,9 @@ parameters:
20031991
schema:
20041992
type: 'string'
20051993
format: 'zip-code'
2006-
examples:
2007-
zip-example:
2008-
$ref: '#/components/examples/zip-example'
1994+
examples:
1995+
zip-example:
1996+
$ref: '#/components/examples/zip-example'
20091997
```
20101998

20111999
In a response:

0 commit comments

Comments
 (0)