Skip to main content

header-example-or-examples-exist

Overview

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

The examples or example property must be present in a header object to provide sample values for the header. It can be used to provide one or more examples, depending on the type of the header. The absence of examples or example property in a header object can make it difficult for API consumers to understand the intended use of the header.

PropertyValue
EnabledYes
Maximum SeverityInformation
MessageExamples are missing from header object.
CodeOPENAPI3DOCSGEN_L661
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Headers
Products ImpactedDeveloper Experience Portal
Tagsdocumentation generation documentation docs openapi3 openapi semantic linting apimatic description header

Suggested Fixes

  • Add the examples or example property to the header object and provide the appropriate value(s).
  • If using examples property, provide a unique name for each example value to differentiate between them.
  • Make sure that the example value(s) provided are valid values for the header type and do not contain any sensitive or confidential information.

For More Information