Skip to main content

valid-schema-example

Overview

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

The example value specified for the Schema Object using the example property should be valid for the type definition of that schema.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageSchema Object example does not conform to its type definition.
CodeOPENAPI3STANDARDS_L152
TypeLinting
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting example value schema

Suggested Fixes

  • Ensure that schema example value conforms to the schema type 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.

For More Information