Skip to main content

response-header-non-negative-max-length

Overview

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

The numeric validation keyword maxLength for the header object, must have a non-negative integer value i.e. the value must be greater than or equal to 0.

PropertyValue
EnabledYes
Maximum SeverityError
MessageValue of property maxLength is less than 0 for header object.
CodeSWAGGER20STANDARDS_V228
TypeValidation
Rule SystemSemantic
Broad CategoryResponse Headers
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation max length number integer json schema validator json schema header

Suggested Fixes

  • Ensure that the value for the validation keyword is a valid integer.
  • Ensure that the value is not less than 0 i.e. a negative value.

For More Information