Skip to main content

required-path-parameter-required-attribute

Overview

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

If the Parameter Object location is set to path it must specify the property required with value set to true.

PropertyValue
EnabledYes
Maximum SeverityError
MessageMissing required property required in the path Parameter Object.
CodeOPENAPI3STANDARDS_V081
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation required path parameter

Suggested Fixes

  • Add missing required property in the path Parameter object.
  • required is a boolean property with true or false as possible values. For path parameters, it must be set to true only.
  • If the parameter is not expected to be sent in the path i.e. it is not a template parameter, change the location from path to the desired location e.g. query, header, cookie.
  • If the parameter is not expected to be sent in the path, remove the path parameter entry from the parameters list.

For More Information