pre-defined-operation-parameters-for-expression-request-parameter-source
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
In runtime expression when using the request parameter source location, request parameters must be declared in the parameters section of the parent operation or they cannot be evaluated. This includes request headers.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Referenced request parameter from the runtime expression is not declared in the target Operation Object. |
Code | OPENAPI3STANDARDS_V465 |
Type | Validation |
Rule System | Semantic |
Broad Category | Runtime Expressions |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation parameter runtime expression operation |
Suggested Fixes
- Ensure that the target Operation Object has a
parameters
property. - Ensure that the target Operation Object
parameters
property value is not invalid or null. - Ensure that name of the referenced parameter from the runtime expression exists in the target Operation Object
parameters
list. Names are compared in a case-sensitive manner. - Remove reference to the parameter in the runtime expression if the Operation Object is not expected to have any request parameters.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#runtime-expressions
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#runtime-expressions
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/