Skip to main content

valid-response-header-type

Overview

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

The type of the header object specified using property type of the Header Object must have only one of the following values: string, number, integer, boolean, or array. Other types are not supported or allowed.

PropertyValue
EnabledYes
Maximum SeverityError
MessageInvalid type of header found.
CodeSWAGGER20STANDARDS_V222
TypeValidation
Rule SystemSemantic
Broad CategoryResponse Headers
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation type header object header

Suggested Fixes

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

For More Information