JsonSchemaDefinition

data class JsonSchemaDefinition(val id: String? = null, val schema: String? = null, val type: String = "object", val properties: Map<String, PropertyDefinition> = emptyMap(), val required: List<String> = emptyList(), val additionalProperties: JsonElement? = null, val description: String? = null, val items: PropertyDefinition? = null, val oneOf: List<PropertyDefinition>? = null, val discriminator: Discriminator? = null, val defs: Map<String, PropertyDefinition>? = null) : PropertiesContainer(source)

Represents a JSON Schema definition.

Author

Konstantin Pavlov

Constructors

Link copied to clipboard
constructor(id: String? = null, schema: String? = null, type: String = "object", properties: Map<String, PropertyDefinition> = emptyMap(), required: List<String> = emptyList(), additionalProperties: JsonElement? = null, description: String? = null, items: PropertyDefinition? = null, oneOf: List<PropertyDefinition>? = null, discriminator: Discriminator? = null, defs: Map<String, PropertyDefinition>? = null)

Properties

Link copied to clipboard

Defines whether additional properties are allowed and their schema. Can be:

Link copied to clipboard
@SerialName(value = "$defs")
val defs: Map<String, PropertyDefinition>?

Schema definitions for reusable types (JSON Schema $defs).

Link copied to clipboard

Optional description of the schema.

Link copied to clipboard

Optional discriminator for polymorphic schemas.

Link copied to clipboard
@SerialName(value = "$id")
val id: String?

JSON Schema $id

Link copied to clipboard
Link copied to clipboard

List of alternative schemas for polymorphic types.

Link copied to clipboard

A map of property definitions.

Link copied to clipboard

List of required property names.

Link copied to clipboard
@SerialName(value = "$schema")
val schema: String?

JSON Schema $schema keyword, e.g. https://json-schema.org/draft/2020-12/schema

Link copied to clipboard

The JSON schema type (e.g., "object", "array", "string", etc.).

Functions

Link copied to clipboard

Retrieves the allOf property definition associated with the specified property name.

Link copied to clipboard

Retrieves the anyOf property definition associated with the specified property name.

Link copied to clipboard

Retrieves the array property definition associated with the specified property name.

Link copied to clipboard

Retrieves the boolean property definition associated with the specified property name.

Link copied to clipboard

Retrieves the numeric property definition associated with the specified property name.

Link copied to clipboard

Retrieves the object property definition associated with the specified property name.

Link copied to clipboard

Retrieves the oneOf property definition associated with the specified property name.

Link copied to clipboard

Retrieves the reference property definition associated with the specified property name.

Link copied to clipboard

Retrieves the string property definition associated with the specified property name.