The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.
In OpenAPI 3.1, the Schema Object is fully compatible with JSON Schema 2020-12, with the addition of OpenAPI-specific vocabulary.
This implementation wraps the existing JsonSchema from zio-blocks-schema and adds OpenAPI-specific vocabulary fields.
Value parameters
- discriminator
-
Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description.
- example
-
A 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. Deprecated: The example property 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.
- extensions
-
Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.
- externalDocs
-
Additional external documentation for this schema.
- jsonSchema
-
The underlying JSON Schema 2020-12 schema represented as Json. This contains all standard JSON Schema keywords (type, properties, items, etc.).
- xml
-
This 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.
Attributes
- Companion
- object
- Source
- OpenAPI.scala
- Graph
-
- Supertypes