Skip to main content

no-invalid-media-type-examples

Validates examples attached to request, response, and other media-type objects against their schemas.

AttributeValue
CategoryExamples
MaturitySilver
Starter–StrictWarning
CompleteError

See it fail

schema:
type: object
properties:
amount: { type: number }
example:
amount: twelve

Fix it

Use amount: 12, or change schema when string is intended.

Options

Set allowAdditionalProperties: true to allow example fields absent from schema. Default: false in Starter–Strict.

Nearby: no-invalid-schema-examples, no-invalid-parameter-examples.