Package-level declarations

JSON Schema models, DSL builders, and function calling schema support.

Types

Link copied to clipboard

Represents the constraint for additional properties in a JSON Schema object.

Link copied to clipboard

Additional properties must conform to the specified schema. Corresponds to "additionalProperties": { <schema> } in JSON Schema.

Link copied to clipboard
data class AllOfPropertyDefinition(val allOf: List<PropertyDefinition>, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val type: List<String>? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<JsonElement>? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val minimum: Double? = null, val maximum: Double? = null, val exclusiveMinimum: Double? = null, val exclusiveMaximum: Double? = null, val multipleOf: Double? = null, val properties: Map<String, PropertyDefinition>? = null, val patternProperties: Map<String, PropertyDefinition>? = null, val additionalProperties: AdditionalPropertiesConstraint? = null, val unevaluatedProperties: PropertyDefinition? = null, val propertyNames: PropertyDefinition? = null, val required: List<String>? = null, val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val minProperties: Int? = null, val maxProperties: Int? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val unevaluatedItems: PropertyDefinition? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null, val ref: String? = null, val dynamicRef: String? = null) : PropertyDefinition, CommonSchemaAttributes, ApplicatorContainer, GeneralConstraints

Represents an allOf schema composition.

Link copied to clipboard

Allows any additional properties beyond those explicitly defined. Corresponds to "additionalProperties": true in JSON Schema.

Link copied to clipboard
data class AnyOfPropertyDefinition(val anyOf: List<PropertyDefinition>, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val type: List<String>? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<JsonElement>? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val minimum: Double? = null, val maximum: Double? = null, val exclusiveMinimum: Double? = null, val exclusiveMaximum: Double? = null, val multipleOf: Double? = null, val properties: Map<String, PropertyDefinition>? = null, val patternProperties: Map<String, PropertyDefinition>? = null, val additionalProperties: AdditionalPropertiesConstraint? = null, val unevaluatedProperties: PropertyDefinition? = null, val propertyNames: PropertyDefinition? = null, val required: List<String>? = null, val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val minProperties: Int? = null, val maxProperties: Int? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val unevaluatedItems: PropertyDefinition? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null, val ref: String? = null, val dynamicRef: String? = null) : PropertyDefinition, CommonSchemaAttributes, ApplicatorContainer, GeneralConstraints

Represents an anyOf schema composition.

Link copied to clipboard

Interface for schemas that can be composed of other schemas.

Link copied to clipboard
interface ArrayContainer

Interface representing a container for items in a JSON array schema.

Link copied to clipboard
Link copied to clipboard
data class ArrayPropertyDefinition(val type: List<String> = ARRAY_TYPE, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<JsonArray>? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val unevaluatedItems: PropertyDefinition? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null) : ValuePropertyDefinition<JsonArray> , ArrayContainer

Represents an array property

Link copied to clipboard
Link copied to clipboard
data class BooleanPropertyDefinition(val type: List<String> = BOOLEAN_TYPE, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<Boolean>? = null) : ValuePropertyDefinition<Boolean>

Represents a boolean property

Link copied to clipboard

Represents a boolean schema in JSON Schema.

Link copied to clipboard

Common keywords for all object-based JSON schemas.

Link copied to clipboard

Disallows any additional properties beyond those explicitly defined. Corresponds to "additionalProperties": false in JSON Schema.

Link copied to clipboard
data class Discriminator(val propertyName: String = "type", val mapping: Map<String, String>? = null)

Represents a discriminator for polymorphic schemas.

Link copied to clipboard
Link copied to clipboard
data class FunctionCallingSchema(val type: String = "function", val name: String, val title: String? = null, val description: String? = null, val strict: Boolean? = true, val parameters: ObjectPropertyDefinition)

FunctionCallingSchema describes a function/tool call in LLM function calling APIs.

Link copied to clipboard

Combined interface for all structural validation keywords.

Link copied to clipboard
Link copied to clipboard
data class GenericPropertyDefinition(val type: List<String>? = null, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val enum: List<JsonElement>? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val properties: Map<String, PropertyDefinition>? = null, val patternProperties: Map<String, PropertyDefinition>? = null, val additionalProperties: AdditionalPropertiesConstraint? = null, val propertyNames: PropertyDefinition? = null, val required: List<String>? = null, val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val dependencies: Map<String, JsonElement>? = null, val unevaluatedItems: PropertyDefinition? = null, val unevaluatedProperties: PropertyDefinition? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val minimum: Double? = null, val maximum: Double? = null, val exclusiveMinimum: Double? = null, val exclusiveMaximum: Double? = null, val multipleOf: Double? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null, val minProperties: Int? = null, val maxProperties: Int? = null) : ValuePropertyDefinition<JsonElement> , GeneralConstraints

Represents a property definition without specific type constraints.

Link copied to clipboard
data class JsonSchema(val schema: String? = null, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val type: List<String> = OBJECT_TYPE, val enum: List<JsonElement>? = null, val constValue: JsonElement? = null, val default: JsonElement? = null, val properties: Map<String, PropertyDefinition> = emptyMap(), val patternProperties: Map<String, PropertyDefinition>? = null, val additionalProperties: AdditionalPropertiesConstraint? = null, val unevaluatedProperties: PropertyDefinition? = null, val propertyNames: PropertyDefinition? = null, val required: List<String> = emptyList(), val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val dependencies: Map<String, JsonElement>? = null, val minProperties: Int? = null, val maxProperties: Int? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val unevaluatedItems: PropertyDefinition? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val minimum: Double? = null, val maximum: Double? = null, val exclusiveMinimum: Double? = null, val exclusiveMaximum: Double? = null, val multipleOf: Double? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val not: PropertyDefinition? = null, val discriminator: Discriminator? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val nullable: Boolean? = null, val defs: Map<String, PropertyDefinition>? = null) : GeneralConstraints, CommonSchemaAttributes, ApplicatorContainer, PropertyDefinition

Represents a JSON Schema with validation constraints and metadata according to the JSON Schema specification.

Link copied to clipboard

Builder for JsonSchema.

Link copied to clipboard

Collection of special constants, such as keys and data types, from JSON schema definition.

Link copied to clipboard
annotation class JsonSchemaDsl

Marker annotation for the JSON Schema DSL.

Link copied to clipboard

Numeric validation keywords.

Link copied to clipboard
Link copied to clipboard
data class NumericPropertyDefinition(val type: List<String>, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<Double>? = null, val multipleOf: Double? = null, val minimum: Double? = null, val exclusiveMinimum: Double? = null, val maximum: Double? = null, val exclusiveMaximum: Double? = null) : ValuePropertyDefinition<Double> , NumericConstraints

Represents a numeric property (integer or number).

Link copied to clipboard
Link copied to clipboard
data class ObjectPropertyDefinition(val type: List<String> = OBJECT_TYPE, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<JsonObject>? = null, val properties: Map<String, PropertyDefinition>? = null, val patternProperties: Map<String, PropertyDefinition>? = null, val unevaluatedProperties: PropertyDefinition? = null, val propertyNames: PropertyDefinition? = null, val required: List<String>? = null, val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val dependencies: Map<String, JsonElement>? = null, val minProperties: Int? = null, val maxProperties: Int? = null, val additionalProperties: AdditionalPropertiesConstraint? = null) : ValuePropertyDefinition<JsonObject> , PropertiesContainer

Represents an object property

Link copied to clipboard
data class OneOfPropertyDefinition(val oneOf: List<PropertyDefinition>, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val type: List<String>? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<JsonElement>? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val minimum: Double? = null, val maximum: Double? = null, val exclusiveMinimum: Double? = null, val exclusiveMaximum: Double? = null, val multipleOf: Double? = null, val discriminator: Discriminator? = null, val properties: Map<String, PropertyDefinition>? = null, val patternProperties: Map<String, PropertyDefinition>? = null, val additionalProperties: AdditionalPropertiesConstraint? = null, val unevaluatedProperties: PropertyDefinition? = null, val propertyNames: PropertyDefinition? = null, val required: List<String>? = null, val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val minProperties: Int? = null, val maxProperties: Int? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val unevaluatedItems: PropertyDefinition? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null, val ref: String? = null, val dynamicRef: String? = null) : PropertyDefinition, CommonSchemaAttributes, ApplicatorContainer, GeneralConstraints

Represents a oneOf schema composition.

Link copied to clipboard

Common interface for builders that collect polymorphic schema options.

Link copied to clipboard

Interface representing a container for properties in a JSON schema.

Link copied to clipboard

Builder for defining property types and constraints.

Link copied to clipboard

Represents a property definition in a JSON Schema.

Link copied to clipboard
data class ReferencePropertyDefinition(val ref: String? = null, val dynamicRef: String? = null, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val type: List<String>? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val enum: List<JsonElement>? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val minimum: Double? = null, val maximum: Double? = null, val exclusiveMinimum: Double? = null, val exclusiveMaximum: Double? = null, val multipleOf: Double? = null, val properties: Map<String, PropertyDefinition>? = null, val patternProperties: Map<String, PropertyDefinition>? = null, val additionalProperties: AdditionalPropertiesConstraint? = null, val unevaluatedProperties: PropertyDefinition? = null, val propertyNames: PropertyDefinition? = null, val required: List<String>? = null, val dependentRequired: Map<String, List<String>>? = null, val dependentSchemas: Map<String, PropertyDefinition>? = null, val minProperties: Int? = null, val maxProperties: Int? = null, val items: PropertyDefinition? = null, val prefixItems: List<PropertyDefinition>? = null, val unevaluatedItems: PropertyDefinition? = null, val contains: PropertyDefinition? = null, val minContains: Int? = null, val maxContains: Int? = null, val minItems: Int? = null, val maxItems: Int? = null, val uniqueItems: Boolean? = null) : PropertyDefinition, CommonSchemaAttributes, ApplicatorContainer, GeneralConstraints

Represents a reference to another element

Link copied to clipboard

String validation keywords.

Link copied to clipboard
Link copied to clipboard
data class StringPropertyDefinition(val type: List<String> = STRING_TYPE, val id: String? = null, val anchor: String? = null, val dynamicAnchor: String? = null, val ref: String? = null, val dynamicRef: String? = null, val comment: String? = null, val title: String? = null, val description: String? = null, val nullable: Boolean? = null, val default: JsonElement? = null, val constValue: JsonElement? = null, val defs: Map<String, PropertyDefinition>? = null, val readOnly: Boolean? = null, val writeOnly: Boolean? = null, val deprecated: Boolean? = null, val examples: List<JsonElement>? = null, val oneOf: List<PropertyDefinition>? = null, val anyOf: List<PropertyDefinition>? = null, val allOf: List<PropertyDefinition>? = null, val not: PropertyDefinition? = null, val ifSchema: PropertyDefinition? = null, val thenSchema: PropertyDefinition? = null, val elseSchema: PropertyDefinition? = null, val format: String? = null, val contentEncoding: String? = null, val contentMediaType: String? = null, val contentSchema: PropertyDefinition? = null, val enum: List<String>? = null, val minLength: Int? = null, val maxLength: Int? = null, val pattern: String? = null) : ValuePropertyDefinition<String> , StringConstraints

Represents a string property.

Link copied to clipboard

Represents a value-based property definition in a JSON Schema.

Functions

Link copied to clipboard

Adds a nested allOf schema option.

Link copied to clipboard

Adds a nested anyOf schema option.

Link copied to clipboard

Adds an array schema option.

Link copied to clipboard

Adds a boolean schema option.

Link copied to clipboard

Encodes the given FunctionCallingSchema instance into a JsonObject representation.

Encodes this JsonSchema to a JsonObject.

Link copied to clipboard

Encodes the FunctionCallingSchema instance into its JSON string representation.

Encodes this JsonSchema to a JSON string.

Link copied to clipboard

Adds an integer schema option.

Link copied to clipboard

DSL for building JSON Schema objects in a type-safe and readable way.

Link copied to clipboard

Adds a number schema option.

Link copied to clipboard

Adds an object schema option.

Link copied to clipboard

Adds a nested oneOf schema option.

Link copied to clipboard

Adds a reference schema option.

Link copied to clipboard

Adds a string schema option.