Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageParameter location is invalid.
CodeSWAGGER20STANDARDS_V097
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 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, formData or body.
  • Ensure that the value for parameter location is not null or empty.

For More Information