Skip to content

Commit c815866

Browse files
committed
Updates to style parameter
1 parent 840de94 commit c815866

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

versions/3.0.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ Field Name | Type | Description
748748
<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.
749749
<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`.
750750
<a name="parameterDeprecated"></a> deprecated | `boolean` | Specifies that a parameter is deprecated and should be transitioned out of usage.
751-
<a name="parameterAllowUnreserved"></a>allowReserved | `boolean` | Determines whether the parameter value should allow reserved characters `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
752751

753752
The content of the parameter is specified in one of two ways. By passing a schema and content-type, complex parameters may be serialized and passed:
754753

@@ -763,6 +762,8 @@ Field Name | Type | Description
763762
<a name="parameterType"></a>type | `string` | **Required.** The type of the parameter. Since the parameter is not located at the request body, it is limited to simple types (that is, not an object). The value MUST be one of `"string"`, `"number"`, `"integer"`, `"boolean"`, `"array"` or `"object"`.
764763
<a name="parameterFormat"></a>format | `string` | The extending format for the previously mentioned [`type`](#parameterType). See [Data Type Formats](#dataTypeFormat) for further details.
765764
<a name="parameterStyle"></a>style | `string` | Describes how the parameter value will be serialized depending on the specified [`type`](#parameterType).
765+
<a name="parameterAllowUnreserved"></a>allowReserved | `boolean` | Determines whether the parameter value should allow reserved characters `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
766+
<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.
766767
<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`.
767768
<a name="parameterItems"></a>items | [Items Object](#itemsObject) | **Required if [`type`](#parameterType) is "array".** Describes the type of items in the array.
768769
<a name="parameterDefault"></a>default | * | Declares the value of the parameter that the server will use if none is provided, for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request. (Note: "default" has no meaning for required parameters.) See http://json-schema.org/latest/json-schema-validation.html#anchor101. Unlike JSON Schema this value MUST conform to the defined [`type`](#parameterType) for this parameter.
@@ -779,21 +780,18 @@ Field Name | Type | Description
779780
<a name="parameterEnum"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.
780781
<a name="parameterMultipleOf"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.
781782

782-
In order to support some of the commonly used parameter serializations, a set of `style` values are defined.
783+
In order to support alternate ways of serializing parameters, a set of `style` values are defined.
783784

784785
`style` | [`type`](#dataTypeType) | `in` | Comments
785786
----------- | ------ | -------- | --------
786-
matrix | `string`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
787-
exploded-matrix | `array`, `object` | `path` | Exploded path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
787+
matrix | `string`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
788788
label | `string`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
789-
exploded-label | `object` | `path`| Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
790789
form | `string`, `array`, `object` | `query`| Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8)
791-
exploded-form | `array`, `object` | `query` | Exploded form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8)
792-
space-delimited | `array` | `query`,`path` | This option replaces `collectionFormat` equal to `ssv`
793-
pipe-delimited | `array` | `query`,`path` | This option replaces `collectionFormat` equal to `pipes`
794-
exploded-object | `object` | `query` | Provides a simple way of rendering nested objects using form parameters
790+
comma-delimited | `array` | `query`, `path` | Comma separated array values. This option replaces `collectionFormat` equal to `csv`.
791+
space-delimited | `array` | `query`, `path` | Space separated array values. This option replaces `collectionFormat` equal to `ssv`.
792+
pipe-delimited | `array` | `query`, `path` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes`.
793+
deep-object | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
795794

796-
comma-delimited ???
797795

798796
Examples:
799797
Assuming a parameter named `value` with one of the following values:
@@ -805,18 +803,17 @@ Assuming a parameter named `value` with one of the following values:
805803
```
806804
The following table shows examples of how those values would be rendered.
807805

808-
[`style`](#dataTypeFormat) | `empty` | `string` | `array` | `object`
809-
----------- | ------ | -------- | -------- | --------
810-
matrix | ;value | ;value=hello | ;value=blue,black,brown | ;value=x,100,y200
811-
exploded-matrix | n/a | n/a | ;value=blue;value=black;value=brown | ;x=100;y=100
812-
label | . | .hello | .blue.black.brown | .x.100.y.200
813-
exploded-label | n/a | n/a | n/a | .x=100.y=200
814-
form | . | value=hello | value=blue,black,brown | value=x,100,y,200
815-
exploded-form | n/a | n/a | value=blue&value=black&value=brown | x=100&y=200
816-
space-delimited | n/a | n/a | blue%20black%20brown | x%20100%20y%20200
817-
pipe-delimited | n/a | n/a | blue\|black\|brown | x\|100\|y\|200
818-
exploded-object | n/a | n/a | n/a | person[name]=Bob&person[lastname]=Brown
819-
806+
[`style`](#dataTypeFormat) | `explode` | `empty` | `string` | `array` | `object`
807+
----------- | ------ | -------- | -------- | --------|-------
808+
matrix | false | ;value | ;value=hello | ;value=blue,black,brown | ;value=x,100,y200
809+
matrix | true | n/a | n/a | ;value=blue;value=black;value=brown | ;x=100;y=100
810+
label | false | . | .hello | .blue.black.brown | .x.100.y.200
811+
label | true | n/a | n/a | n/a | .x=100.y=200
812+
form | false | . | value=hello | value=blue,black,brown | value=x,100,y,200
813+
form | true | n/a | n/a | value=blue&value=black&value=brown | x=100&y=200
814+
space-delimited | false | n/a | n/a | blue%20black%20brown | x%20100%20y%20200
815+
pipe-delimited | false | n/a | n/a | blue\|black\|brown | x\|100\|y\|200
816+
deep-object | true | n/a | n/a | n/a | person[name]=Bob&person[lastname]=Brown
820817

821818
This object can be extended with [Specification Extensions](#specificationExtensions).
822819

@@ -837,7 +834,7 @@ A header parameter with an array of 64 bit integer numbers:
837834
"format": "int64"
838835
}
839836
},
840-
"collectionFormat": "csv"
837+
"style": "comma-delimited"
841838
}
842839
```
843840

@@ -851,7 +848,7 @@ schema:
851848
items:
852849
type: integer
853850
format: int64
854-
collectionFormat: csv
851+
style: comma-delimited
855852
```
856853

857854
A path parameter of a string value:
@@ -889,7 +886,8 @@ An optional query parameter of a string value, allowing multiple values by repea
889886
"type": "string"
890887
}
891888
},
892-
"collectionFormat": "multi"
889+
"style": "form",
890+
"explode": true
893891
}
894892
```
895893

@@ -902,7 +900,8 @@ schema:
902900
type: array
903901
items:
904902
type: string
905-
collectionFormat: multi
903+
style: form
904+
explode: true
906905
```
907906

908907
A form data with file type for a file upload:

0 commit comments

Comments
 (0)