Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageReferenced request parameter from the runtime expression is not declared in the target Operation Object.
CodeOPENAPI3STANDARDS_V465
TypeValidation
Rule SystemSemantic
Broad CategoryRuntime Expressions
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 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