Skip to content

Interface: ToJsonSchemaOptions ​

The options of the conversion of a schema into a JSON Schema

Properties ​

definitions? ​

optional definitions?: Record<string, JSONSchema>

An object receiving the shared schemas (the schemas given an id with .id()), by id. The JSON Schema refers to them with $ref (#/$defs/<id>, #/definitions/<id> in draft 04, #/components/schemas/<id> in OpenAPI); the JSON Schema versions also embed them in the root $defs (definitions). An OpenAPI schema object cannot hold them: the OpenAPI targets return them in the root key schemas of the result as well, both to be moved by the caller into the components.schemas of its document.


dialect? ​

optional dialect?: boolean

Whether the JSON Schema declares its version with $schema (JSON Schema versions only, not OpenAPI).

Default ​

ts
false

preferences? ​

optional preferences?: ValidationOptions

The validation options the schema is used with: they decide which unknown keys are accepted (additionalProperties) and which keys are required.

Default ​

ts
the validation options of lakutata (unknown keys allowed, keys optional)

target? ​

optional target?: JsonSchemaTarget

The JSON Schema version to write.

Default ​

ts
'draft-2020-12'

Released under the MIT License.