Skip to main content

valid-header-example

Overview

This rule belongs to the openapi-v3-standards-linting ruleset and states that:

The example value specified for the Header Object using either the example property or examples must be valid for the schema definition and encoding properties (if present) of that header.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageExample does not conform to the header's schema or encoding definition.
CodeOPENAPI3STANDARDS_L133
TypeLinting
Rule SystemSemantic
Broad CategoryHeaders
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting examples example value header schema type encoding style explode

Suggested Fixes

  • Ensure that header example value conforms to the header schema definition.
  • Check that no required properties are missing in the sample value.
  • Check that types of all properties match those specified in the schema definition.
  • Header encoding properties include style and explode.
  • If header level style or explode are specified, ensure that the example is valid with respect to them.

For More Information