required-parameter-location
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The Parameter Object must specify a location for the parameter using the in
property. The location identifies where the parameter needs to be sent in the request and must not be null or empty. Possible values are 'query', 'header', 'path' or 'cookie'.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Required in property in Parameter Object is missing. |
Code | OPENAPI3STANDARDS_V076 |
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
- Add missing
in
property in the Parameter object. - Make sure that the
in
property is not null or empty. - Make sure that the value of the
in
property is one of the following values: 'query', 'header', 'path', 'cookie'. The values are case-sensitive.
For More Information
- 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-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/