parameter-pipe-delimited-style-only-for-array-or-object-types
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
In an OpenAPI v3.1.x document, the pipeDelimited style can only be used when the type of the parameter is set as array or object i.e. it cannot be used for primitive types.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Pipe delimited style cannot be used with the current parameter type. |
| Code | OPENAPI3STANDARDS_V104 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Parameters |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation pipe delimited style array object serialization parameter |
Suggested Fixes
- Ensure that the
typeof the parameter set in either the parameter's schema or content definition is equal toarrayorobject. - If the parameter type is not expected to be an array/object, change the value of the style property to one that supports primitive types e.g. matrix, label, form.
- If the parameter type is not expected to be an array/object and you are unsure about which style to use, simply remove the
styleproperty definition.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/