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's recommended that optional parameters should be defined at the end of the Path Item parameters list and not before or between required parameters.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | Path item parameters are out of order. |
| Code | OPENAPI3CODEGEN_L171 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Path Items |
| Products Impacted | Code Generation, Developer Experience Portal |
| Tags | code 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.