required-path-parameter-required-attribute
Overview
This rule belongs to the swagger-v2-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
.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Missing required property required in the path Parameter Object. |
Code | SWAGGER20STANDARDS_V102 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger standards semantic validation required path parameter |
Suggested Fixes
- Add missing
required
property in the path Parameter object. required
is a boolean property withtrue
orfalse
as possible values. For path parameters, it must be set totrue
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, formData or body. - If the parameter is not expected to be sent in the path, remove the path parameter entry from the parameters list.