valid-parameter-location
Overview
This rule belongs to the swagger-v2-standards-validation ruleset and states that:
Location of a parameter specified using the in property in the Parameter Object must have one of the following possible values only: query, header, path, formData or body. All other values will be treated as invalid.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Parameter location is invalid. |
| Code | SWAGGER20STANDARDS_V097 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Parameters |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger2 swagger standards semantic validation location parameter |
Suggested Fixes
- Location value is compared in a case-sensitive manner.
- Ensure that the location value matches exactly with the possible list of values and that there are no typos:
query,header,path,formDataorbody. - Ensure that the value for parameter location is not null or empty.