path-parameter-cannot-be-optional
Overview
This rule belongs to the swagger-v2-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. If a path parameter is marked as optional, it will automatically be marked as required during import/transformations in APIMatic.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Path parameter is marked as optional. |
| Code | SWAGGER20STANDARDS_V103 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Parameters |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger2 swagger standards semantic validation path parameter required |
Suggested Fixes
- Ensure that the boolean property
requiredexists in the path Parameter Object. - Ensure that the property
requiredhas a value set totrue.