Skip to main content

schema-unclear

Finds schemas whose declared type is not a recognized JSON Schema type.

AttributeValue
CategorySchema
MaturityPlatinum
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
StarterOff
Lenient–StrictWarning
CompleteError

Intent

An unknown type makes the schema's accepted data ambiguous and may be interpreted differently by downstream tools.

Flags

A declared type outside object, array, string, number, integer, boolean, and null.

Does not flag

Known types or schemas that do not declare a type. Other rules may report a missing type when one is required.

See it fail

Mystery:
type: text

Diagnostic: Schema is unclear

Fix it

Use the JSON Schema type that describes the value:

Mystery:
type: string

Configure

profiles:
default:
rules:
extends: [recommended]
override:
schema-unclear: error

Nearby: no-schema-type-mismatch.