Skip to main content

dollar-schema-overrides-default-oas-schema-dialect

Overview

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

If $schema is defined explicitly in a Schema Object of the OpenAPI document, it overrides the default schema dialect specified using jsonSchemaDialect in the OpenAPI Object or the implicit OpenAPI dialect schema Id https://spec.openapis.org/oas/3.1/dialect/base if jsonSchemaDialect is not set. An exception to this rule is for schemas defined in external non-OAS documents.

PropertyValue
EnabledYes
Maximum SeverityInformation
Message$schema used in Schema Object overrides the default OAS schema dialect.
CodeOPENAPI3STANDARDS_L157
TypeLinting
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting $schema dialect schema

Suggested Fixes

  • If you do not wish to override the default schema dialects (specified either using jsonSchemaDialect or via the implicit OAS dialect schema Id), consider removing the $schema property from Schema Objects of OAS documents.

For More Information