Skip to main content

valid-response-header-default-value-type

Overview

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

Default value must conform to the defined type for the Header Object defined at the same level in a Swagger 2.0 document.

PropertyValue
EnabledYes
Maximum SeverityError
MessageDefault value does not conform to the defined items type for this header object.
CodeSWAGGER20STANDARDS_V225
TypeValidation
Rule SystemSemantic
Broad CategoryResponse Headers
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation default value default header

Suggested Fixes

  • If an array is expected, ensure that your value is surrounded by square brackets [ and ].
  • If an array is not expected, ensure that your value contains a single item only and is not surrounded by square brackets [ and ].
  • If a numeric value is expected, ensure that your value is a valid number and it is not surrounded by single or double quotes.
  • If a string value is expected, ensure that it is escaped properly and surrounded by quotes if necessary.
  • If a boolean value is expected, ensure that your value is either true or false only and is not surrounded by quotes.

For More Information