Skip to main content

valid-header-content-key

Overview

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

Key of a header content map must be set as a specific media type which is in compliance with RFC6838.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageThe key of the header content map definition is invalid.
CodeOPENAPI3SYNTAX_L120
TypeLinting
Rule SystemSyntax
Broad CategoryHeaders
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi syntax linting media type content header

Suggested Fixes

  • A media type consists of a top-level type and a subtype, which is further structured into a tree. A media type can optionally define a suffix and parameters as well.
  • A media type follows a pattern like the following where segments between [] are optional segments: <type>/[<tree>.]<subtype>[+<suffix>]*[;<parameter>]
  • Some examples of valid media types are: application/json, application/vnd.api+json, text/plain.

For More Information