Skip to content

Commit eb95f04

Browse files
authored
Merge pull request #3760 from handrews/param-fields
Clarify constraints on Parameter Object fields (3.0.4)
2 parents 2f8df3d + 0eccb52 commit eb95f04

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

versions/3.0.4.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,14 @@ There are four possible parameter locations specified by the `in` field:
10161016

10171017

10181018
##### Fixed Fields
1019+
1020+
The rules for serialization of the parameter are specified in one of two ways.
1021+
Parameter Objects MUST include either a `content` field or a `schema` field, but not both.
1022+
1023+
###### Common Fixed Fields
1024+
1025+
These fields MAY be used with either `content` or `schema`.
1026+
10191027
Field Name | Type | Description
10201028
---|:---:|---
10211029
<a name="parameterName"></a>name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*. <ul><li>If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to a template expression occurring within the [path](#pathsPath) field in the [Paths Object](#pathsObject). See [Path Templating](#pathTemplating) for further information.<li>If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.<li>For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.</ul>
@@ -1025,8 +1033,10 @@ Field Name | Type | Description
10251033
<a name="parameterDeprecated"></a> deprecated | `boolean` | Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
10261034
<a name="parameterAllowEmptyValue"></a> allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If [`style`](#parameterStyle) is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
10271035

1028-
The rules for serialization of the parameter are specified in one of two ways.
1036+
###### Fixed Fields for use with `schema`
1037+
10291038
For simpler scenarios, a [`schema`](#parameterSchema) and [`style`](#parameterStyle) can describe the structure and syntax of the parameter.
1039+
When `example` or `examples` are provided in conjunction with the `schema` object, the example MUST follow the prescribed serialization strategy for the parameter.
10301040

10311041
Field Name | Type | Description
10321042
---|:---:|---
@@ -1037,10 +1047,9 @@ Field Name | Type | Description
10371047
<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.
10381048
<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.
10391049

1040-
For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
1041-
A parameter MUST contain either a `schema` property, or a `content` property, but not both.
1042-
When `example` or `examples` are provided in conjunction with the `schema` object, the example MUST follow the prescribed serialization strategy for the parameter.
1050+
###### Fixed Fields and considerations for use with `content`
10431051

1052+
For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter, as well as give examples of it use.
10441053

10451054
Field Name | Type | Description
10461055
---|:---:|---

0 commit comments

Comments
 (0)