Skip to content

Commit aa4f873

Browse files
committed
Fixes to parameter and requestBody
1 parent 7141ddf commit aa4f873

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

versions/3.0.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -752,19 +752,19 @@ Field Name | Type | Description
752752
<a name="parameterDescription"></a>description | `string` | A brief description of the parameter. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
753753
<a name="parameterRequired"></a>required | `boolean` | Determines whether this parameter is mandatory. If the parameter is [`in`](#parameterIn) "path", this property is **required** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
754754
<a name="parameterDeprecated"></a> deprecated | `boolean` | Specifies that a parameter is deprecated and should be transitioned out of usage.
755-
<a name="parameterAllowEmptyValue"/>allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows you to send a parameter with a name only or an empty value. Default value is `false`.
755+
<a name="parameterAllowEmptyValue"/>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, if behavior is `n/a`, the value of `allowEmptyValue` SHALL be ignored.
756756

757757
The rules for serialization of the parameter are specified in one of two ways.
758-
For simpler scenarios, a `Style` and `Schema` can be used to describe the structure and syntax of the parameter.
758+
For simpler scenarios, a [`style`](#parameterStyle) and [`schema`](#parameterSchema) can be used to describe the structure and syntax of the parameter.
759759

760760
Field Name | Type | Description
761761
---|:---:|---
762-
<a name="parameterStyle"></a>style | `string` | Describes how the parameter value will be serialized depending on type of the parameter value.
762+
<a name="parameterStyle"></a>style | `string` | Describes how the parameter value will be serialized depending on type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
763763
<a name="parameterExplode"></a>explode | `boolean` | When this is true, parameter values of type `array` or `object` generate seperate parameters for each value of the array, or key-value-pair of the map. For other types of parameters this property has no effect. The default value is false.
764764
<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`.
765765
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter.
766766

767-
For more complex scenarios a `content` object can be used to define the media-type and schema of the parameter.
767+
For more complex scenarios a [`content`](#paramterContent) object can be used to define the media-type and schema of the parameter.
768768

769769
Field Name | Type | Description
770770
---|:---:|---
@@ -776,8 +776,8 @@ In order to support common ways of serializing simple parameters, a set of `styl
776776
----------- | ------ | -------- | --------
777777
matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
778778
label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
779-
form | `primitive`, `array`, `object` | `query`| Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8)
780-
commaDelimited | `array` | `query`, `path` | Comma seperated array values. This option replaces `collectionFormat` equal to `csv`.
779+
form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` equal to `csv`.
780+
simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2).
781781
spaceDelimited | `array` | `query` | Space seperated array values. This option replaces `collectionFormat` equal to `ssv`.
782782
pipeDelimited | `array` | `query` | Pipe seperated array values. This option replaces `collectionFormat` equal to `pipes`.
783783
deepObject | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
@@ -802,7 +802,8 @@ label | false | . | .blue | .blue.black.brown | .R.100.G.200.B.150
802802
label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150
803803
form | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150
804804
form | true | color= | color=blue | color=blue&color=black&color=brown | R=100&G=200&B=150
805-
commaDelimited | false | n/a | n/a | blue,black,brown | R,100,G,200,B,150
805+
simple | false | n/a | blue | blue,black,brown | R,100,G,200,B,150
806+
simple | true | n/a | n/a | blue,black,brown | R=100,G=200,B=150
806807
spaceDelimited | false | n/a | n/a | blue%20black%20brown | R%20100%20G%20200%20B%20150
807808
pipeDelimited | false | n/a | n/a | blue\|black\|brown | R\|100\|G\|200|G\|150
808809
deepObject | true | n/a | n/a | n/a | color[R]=100&color[G]=200&color[B]=150
@@ -896,6 +897,28 @@ style: form
896897
explode: true
897898
```
898899

900+
A free-form query parameter, allowing undefined parameters of a specific type:
901+
```json
902+
{
903+
"in": "query",
904+
"name": "freeForm",
905+
"type": "object",
906+
"additionalProperties": {
907+
"type": "integer"
908+
},
909+
"style": "form"
910+
}
911+
```
912+
913+
```yaml
914+
in: query
915+
name: freeForm
916+
type: object
917+
additionalProperties:
918+
type: integer
919+
style: form
920+
```
921+
899922
#### <a name="requestBodyObject"></a>Request Body Object
900923

901924
Describes a single request body.
@@ -1176,7 +1199,7 @@ requestBody:
11761199
11771200
Note that in the above example, the contents in the `requestBody` must be stringified per RFC1866 when being passed to the server. In addition, the `address` field complex object will be strigified as well.
11781201

1179-
When passing complex objects in the `x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the `parameterContent` section as `deepObject`.
1202+
When passing complex objects in the `x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the `parameterContent` section as `form`.
11801203

11811204
##### Special Considerations for `mutlipart` content
11821205

@@ -1239,10 +1262,10 @@ A single encoding definition applied to a single schema property
12391262
##### Fixed Fields
12401263
Field Name | Type | Description
12411264
---|:---:|---
1242-
<a name="contentType"></a>contentType | `string` | **Required.** The content-type to use for encoding a specific property.
1243-
<a name="headers"></a>Headers | `object` | A string map allowing additional information to be provided as headers, for example `Content-Disposition`. Note `Content-Type` is described separately and will be ignored from this section.
1244-
<a name="style"></a>Style | `string` | The content-type to use for encoding a specific property. See (#parameterContent) for details on the `style` property
1245-
<a name="explode"></a>explode | `boolean` | When this is true, property values of type `array` or `object` generate seperate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. The default value is false.
1265+
<a name="encodingContentType"></a>contentType | `string` | The content-type to use for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` - `application/octet-stream`; for other primitive types - `plain/text`; for `object` - `application/json`; for `array` - the default is defined based on the inner type.
1266+
<a name="encodingHeaders"></a>Headers | `object` | A string map allowing additional information to be provided as headers, for example `Content-Disposition`. Note `Content-Type` is described separately and will be ignored from this section.
1267+
<a name="encodingStyle"></a>style | `string` | The content-type to use for encoding a specific property. See (#parameterContent) for details on the [`style`](#parameterStyle) property. The behavior follows the same values allowed for `query` parameters, including default values.
1268+
<a name="encodingExplode"></a>explode | `boolean` | When this is true, property values of type `array` or `object` generate seperate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. The default value is false.
12461269

12471270
This object can be extended with [Specification Extensions](#specificationExtensions).
12481271

0 commit comments

Comments
 (0)