Skip to content

[T] OpenAPI3Schema

type OpenAPI3Schema = Extensions & object;

Type declaration

NameTypeDescription
additionalProperties?| boolean | Refable<OpenAPI3Schema>indicates that additional unlisted properties can exist in this schema
allOf?Refable<OpenAPI3Schema>[]A collection of schemas that this schema also must conform to. An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword’s value. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.26
anyOf?Refable<OpenAPI3Schema>[]A collection of schemas that this schema may conform to one or more of. An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword’s value. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.27
default?string | boolean | number | Record<string, any>Declares the value of the property that the server will use if none is provided, for example a “count” to control the number of results per page might default to 100 if not supplied by the client in the request. Note “default” has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter.
deprecated?booleanSpecifies that a schema is deprecated and SHOULD be transitioned out of usage.Default value is false.
description?stringThis attribute is a string that provides a full description of the schema
discriminator?OpenAPI3DiscriminatorAdds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description
enum?(string | number | boolean)[]This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.23
example?anyA free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
exclusiveMaximum?booleanRepresenting an exclusive upper limit for a numeric instance. This keyword validates only if the instance is strictly less than (not equal to) to “exclusiveMaximum”. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.3
exclusiveMinimum?booleanRepresenting an exclusive lower limit for a numeric instance. This keyword validates only if the instance is strictly greater than (not equal to) to “exclusiveMinimum”. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.5
externalDocs?OpenAPI3ExternalDocsAdditional external documentation for this schema.
format?stringThe extending format for the previously mentioned type.
items?Refable<OpenAPI3Schema>This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
maximum?numberRepresenting an inclusive upper limit for a numeric instance. This keyword validates only if the instance is less than or exactly equal to “maximum”. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.2
maxItems?numberMust be a non-negative integer. An array instance is valid against “maxItems” if its size is less than, or equal to, the value of this keyword. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.11
maxLength?numberMust be a non-negative integer. A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.6
maxProperties?numberMust be a non-negative integer. An object instance is valid against “maxProperties” if its number of properties is less than, or equal to, the value of this keyword. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.15
minimum?numberRepresenting an inclusive lower limit for a numeric instance. This keyword validates only if the instance is greater than or exactly equal to “minimum”. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.4
minItems?numberMust be a non-negative integer. An array instance is valid against “maxItems” if its size is greater than, or equal to, the value of this keyword. Omitting this keyword has the same behavior as a value of 0. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.12
minLength?numberMust be a non-negative integer. A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. Omitting this keyword has the same behavior as a value of 0. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.7
minProperties?numberMust be a non-negative integer. An object instance is valid against “maxProperties” if its number of properties is greater than, or equal to, the value of this keyword. Omitting this keyword has the same behavior as a value of 0. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.16
multipleOf?numberMust be strictly greater than 0. A numeric instance is valid only if division by this keyword’s value results in an integer. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.1
not?Refable<OpenAPI3Schema>An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.29
nullable?booleanAllows sending a null value for the defined schema. Default value is false.
oneOf?Refable<OpenAPI3Schema>[]A collection of schemas that this schema may conform to only one of. An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword’s value. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.28
pattern?stringShould be a valid regular expression, according to the ECMA 262 regular expression dialect. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.8
properties?Record<string, OpenAPI3SchemaProperty>This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition’s value MUST be a schema, and the property’s name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order.
readOnly?booleanProperty is readonly.
required?string[]Elements of this array must be unique. An object instance is valid against this keyword if every item in the array is the name of a property in the instance. Omitting this keyword has the same behavior as an empty array. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.17
title?stringThis attribute is a string that provides a short description of the instance property. See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
type?JsonTypethe JSON type for the schema
uniqueItems?booleanIf this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique. Omitting this keyword has the same behavior as a value of false. See https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.13
xml?OpenAPI3XmlSchemaThis MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.