You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versions/3.0.md
+35-49
Original file line number
Diff line number
Diff line change
@@ -591,6 +591,8 @@ There are five possible parameter types.
591
591
* `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple parameters that are being transferred.
592
592
* `multipart/form-data` - each parameter takes a section in the payload with an internal header. For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is `submit-name`. This type of form parameters is more commonly used for file transfers.
593
593
594
+
For complex parameter schemas, a serialization strategy is required. For parameter of type `in: body`, the serialization will be handled by the `consumes` attribute. For all other types, a serialization strategy must be declared.
595
+
594
596
##### Fixed Fields
595
597
Field Name | Type | Description
596
598
---|:---:|---
@@ -599,35 +601,7 @@ Field Name | Type | Description
599
601
<a name="parameterDescription"></a>description | `string` | A brief description of the parameter. This could contain examples of use. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.
600
602
<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`.
601
603
<a name="parameterDeprecated"></a> deprecated | `boolean` | Specifies that a parameter is deprecated and should be transitioned out of usage.
602
-
603
-
If [`in`](#parameterIn) is `"body"`:
604
-
605
-
Field Name | Type | Description
606
-
---|:---:|---
607
-
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | **Required.** The schema defining the type used for the body parameter.
608
-
609
-
If [`in`](#parameterIn) is any value other than `"body"`:
610
-
611
-
Field Name | Type | Description
612
-
---|:---:|---
613
-
<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 `"file"`. If `type` is `"file"`, the [`consumes`](#operationConsumes) MUST be either `"multipart/form-data"`, `" application/x-www-form-urlencoded"` or both and the parameter MUST be [`in`](#parameterIn) `"formData"`.
614
-
<a name="parameterFormat"></a>format | `string` | The extending format for the previously mentioned [`type`](#parameterType). See [Data Type Formats](#dataTypeFormat) for further details.
615
-
<a name="parameterAllowEmptyValue"/>allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for either `query` or `formData` parameters and allows you to send a parameter with a name only or an empty value. Default value is `false`.
616
-
<a name="parameterItems"></a>items | [Items Object](#itemsObject) | **Required if [`type`](#parameterType) is "array".** Describes the type of items in the array.
617
-
<a name="parameterCollectionFormat"></a>collectionFormat | `string` | Determines the format of the array if type array is used. Possible values are: <ul><li>`csv` - comma separated values `foo,bar`. <li>`ssv` - space separated values `foo bar`. <li>`tsv` - tab separated values `foo\tbar`. <li>`pipes` - pipe separated values <code>foo|bar</code>. <li>`multi` - corresponds to multiple parameter instances instead of multiple values for a single instance `foo=bar&foo=baz`. This is valid only for parameters [`in`](#parameterIn) "query" or "formData". </ul> Default value is `csv`.
618
-
<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.
619
-
<a name="parameterMaximum"></a>maximum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.
620
-
<a name="parameterExclusiveMaximum"></a>exclusiveMaximum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.
621
-
<a name="parameterMinimum"></a>minimum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.
622
-
<a name="parameterExclusiveMinimum"></a>exclusiveMinimum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.
623
-
<a name="parameterMaxLength"></a>maxLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor26.
624
-
<a name="parameterMinLength"></a>minLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor29.
625
-
<a name="parameterPattern"></a>pattern | `string` | See http://json-schema.org/latest/json-schema-validation.html#anchor33.
626
-
<a name="parameterMaxItems"></a>maxItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor42.
627
-
<a name="parameterMinItems"></a>minItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor45.
628
-
<a name="parameterUniqueItems"></a>uniqueItems | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor49.
629
-
<a name="parameterEnum"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.
630
-
<a name="parameterMultipleOf"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.
604
+
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter.
631
605
632
606
633
607
##### Patterned Fields
@@ -699,10 +673,12 @@ A header parameter with an array of 64 bit integer numbers:
699
673
"in": "header",
700
674
"description": "token to be passed as a header",
701
675
"required": true,
702
-
"type": "array",
703
-
"items": {
704
-
"type": "integer",
705
-
"format": "int64"
676
+
"schema": {
677
+
"type": "array",
678
+
"items": {
679
+
"type": "integer",
680
+
"format": "int64"
681
+
}
706
682
},
707
683
"collectionFormat": "csv"
708
684
}
@@ -713,11 +689,12 @@ name: token
713
689
in: header
714
690
description: token to be passed as a header
715
691
required: true
716
-
type: array
717
-
items:
718
-
type: integer
719
-
format: int64
720
-
collectionFormat: csv
692
+
schema:
693
+
type: array
694
+
items:
695
+
type: integer
696
+
format: int64
697
+
collectionFormat: csv
721
698
```
722
699
723
700
A path parameter of a string value:
@@ -727,7 +704,9 @@ A path parameter of a string value:
727
704
"in": "path",
728
705
"description": "username to fetch",
729
706
"required": true,
730
-
"type": "string"
707
+
"schema": {
708
+
"type": "string"
709
+
}
731
710
}
732
711
```
733
712
@@ -736,7 +715,8 @@ name: username
736
715
in: path
737
716
description: username to fetch
738
717
required: true
739
-
type: string
718
+
schema:
719
+
type: string
740
720
```
741
721
742
722
An optional query parameter of a string value, allowing multiple values by repeating the query parameter:
@@ -746,9 +726,11 @@ An optional query parameter of a string value, allowing multiple values by repea
746
726
"in": "query",
747
727
"description": "ID of the object to fetch",
748
728
"required": false,
749
-
"type": "array",
750
-
"items": {
751
-
"type": "string"
729
+
"schema": {
730
+
"type": "array",
731
+
"items": {
732
+
"type": "string"
733
+
}
752
734
},
753
735
"collectionFormat": "multi"
754
736
}
@@ -759,10 +741,11 @@ name: id
759
741
in: query
760
742
description: ID of the object to fetch
761
743
required: false
762
-
type: array
763
-
items:
764
-
type: string
765
-
collectionFormat: multi
744
+
schema:
745
+
type: array
746
+
items:
747
+
type: string
748
+
collectionFormat: multi
766
749
```
767
750
768
751
A form data with file type for a file upload:
@@ -772,7 +755,9 @@ A form data with file type for a file upload:
0 commit comments