Enforces the inclusion of style and explode fields for parameters with array type or parameters with a schema that includes items or prefixItems.
| OAS | Compatibility |
|---|---|
| 2.0 | ❌ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |
Specifying serialization details consistently helps developers understand how to interact with the API effectively.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default off. |
| in | [string] | List of valid parameter locations where the rule should be enforced. By default the rule applies to parameters in all locations. |
An example configuration:
rules:
array-parameter-serialization:
severity: error
in:
- query
- headerGiven this configuration:
rules:
array-parameter-serialization:
severity: error
in:
- queryExample of incorrect parameter:
paths:
/example:
get:
parameters:
- name: exampleArray
in: query
schema:
type: array
items:
type: stringExample of correct parameter:
paths:
/example:
get:
parameters:
- name: exampleArray
in: query
style: form
explode: true
schema:
type: array
items:
type: string- configurable rules
- boolean-parameter-prefixes
- no-invalid-parameter-examples
- parameter-description
- operation-parameters-unique