Skip to main content

path-item-optional-parameters-after-required-parameters

Overview

This rule belongs to the openapi-v3-codegen-linting ruleset and states that:

For code generation purposes, it is recommended that optional parameters should be defined at the end of the Path Item parameters list and not before or between required parameters.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessagePath item parameters are out of order.
CodeOPENAPI3CODEGEN_L171
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Path Items
Products ImpactedCode Generation, Developer Experience Portal
Tagscode generation sdks openapi3 openapi semantic linting apimatic path parameter parameters order optional required

Suggested Fixes

  • To avoid this issue, define the optional parameters after the required ones, in the parameters list.
  • Enable PreserveParameterOrder CodeGen setting to preserve original parameter order as much as possible.

For More Information