api-morph / SchemaObject
Interface: SchemaObject
Defined in: src/types/openapi.ts:1034
The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true
and a schema which allows no instance to validate MAY be represented by the boolean value false
.
See
https://spec.openapis.org/oas/v3.1.1#schema-object
Extends
Omit
<JsonSchemaDraft202012Object
,"$schema"
>
Indexable
[key
: `x-${string}`
]: any
This object MAY be extended with Specification Extensions.
Properties
$schema?
optional
$schema:string
Defined in: src/types/openapi.ts:1035
discriminator?
optional
discriminator:DiscriminatorObject
Defined in: src/types/openapi.ts:1040
Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details.
example?
optional
example:any
Defined in: src/types/openapi.ts:1061
A free-form field 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.
Deprecated: The example
field has been deprecated in favor of the JSON Schema examples
keyword. Use of example
is discouraged, and later versions of this specification may remove it.
externalDocs?
optional
externalDocs:ExternalDocumentationObject
Defined in: src/types/openapi.ts:1051
Additional external documentation for this schema.
xml?
optional
xml:XMLObject
Defined in: src/types/openapi.ts:1046
This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.