Skip to main content

path-parameter-cannot-be-optional

Overview

This rule belongs to the openapi-v3-standards-validation ruleset and states that:

If the location is set as path, the parameter must be set as required using the property required of the Parameter Object. The value of this property must be set to true.

PropertyValue
EnabledYes
Maximum SeverityError
MessagePath parameter is marked as optional.
CodeOPENAPI3STANDARDS_V082
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation path parameter required

Suggested Fixes

  • Ensure that the boolean property required exists in the path Parameter Object.
  • Ensure that the property required has a value set to true.

For More Information