valid-parameter-location
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
Location of a parameter specified using the in
property in the Parameter Object must have one of the following possible values only: query
, header
, path
or cookie
. All other values will be treated as invalid.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Parameter location is invalid. |
Code | OPENAPI3STANDARDS_V079 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation location parameter |
Suggested Fixes
- Location value is compared in a case-sensitive manner.
- Ensure that the location value matches exactly with the possible list of values and that there are no typos:
query
,header
,path
orcookie
. - Ensure that the value for parameter location is not null or empty.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
- 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#parameter-locations
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/