OAS 3 This page applies to OpenAPI 3 – the latest version of the OpenAPI Specification.
Supported JSON Schema Keywords
OpenAPI 3.0 uses an extended subset of JSON Schema Specification
Wright Draft 00 (aka Draft 5) to describe the data formats. “Extended subset” means that some keywords are supported and some are not, some keywords have slightly different usage than in JSON Schema, and additional keywords are introduced.
These keywords have the same meaning
as in JSON Schema:
These keywords are supported with minor differences
type – the value must be a single type and not an array of types.
format – OpenAPI has its own predefined formats and also allows custom formats.
description – supports CommonMark syntax for rich text representation.
items – must be present if
array. The item schema must be an OpenAPI schema and not a standard JSON Schema.
properties – individual property definitions must follow OpenAPI schema rules and not standard JSON Schema.
additionalProperties – the value can be a boolean (
false) or an OpenAPI schema.
default – the default value must conform to the specified schema.
allOf – the subschemas must be OpenAPI schemas and not standard JSON Schemas.
oneOf – the subschemas must be OpenAPI schemas and not standard JSON Schemas.
anyOf – the subschemas must be OpenAPI schemas and not standard JSON Schemas.
not – the subschema must be an OpenAPI schema and not a standard JSON Schema.
OpenAPI schemas can also use the following keywords that are not part of JSON Schema:
OpenAPI 3.0 – Schema Object
JSON Schema Validation
– JSON Schema keyword reference
JSON Schema Draft Wright 00
– Core Specification