Skip to main content

valid-non-body-parameter-type

Overview

This rule belongs to the swagger-v2-standards-validation ruleset and states that:

Type of a non-body parameter specified using the type property in the Parameter Object must have one of the following possible values only: string, number, integer, boolean, array or file. All other values will be treated as invalid.

PropertyValue
EnabledYes
Maximum SeverityError
MessageType of non-body parameter is invalid.
CodeSWAGGER20STANDARDS_V099
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation type parameter body

Suggested Fixes

  • Type value is compared in a case-sensitive manner.
  • Ensure that the type value matches exactly with the possible list of values and that there are no typos: string, number, integer, boolean, array or file.
  • Ensure that the value for parameter type is not null or empty.

For More Information