AirshipJsonSchema

class AirshipJsonSchema @JvmOverloads constructor(val type: AirshipJsonSchema.ValueType, val description: String? = null, extensions: Map<String, JsonValue> = emptyMap()) : JsonSerializable(source)

Describes the structured JSON output an AI evaluation expects from a model.

A recursive JSON Schema type node, so the output can be an object, an array, or a bare scalar:

{ "type": "object", "properties": { "result": { "type": "string", "enum": ["a", "b"] } }, "required": ["result"] }
{ "type": "array", "items": { "type": "string" } }

Properties are unordered, and per JSON Schema a property is optional unless listed in required. Backend agnostic and in core, so payload-driven features can decode a schema without depending on an AI module.

Parameters

type

The expected shape of the value.

description

Optional natural-language description, surfaced to the model.

extensions

JSON Schema vendor extensions (x-*) carried verbatim as opaque JSON, so new ones round-trip without parser changes. Keys without the prefix, and keys whose value is null, are dropped; validate ignores the rest — they are metadata for other consumers.

Constructors

Link copied to clipboard
constructor(type: AirshipJsonSchema.ValueType, description: String? = null, extensions: Map<String, JsonValue> = emptyMap())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed class ValueType

The shape of a schema node.

Properties

Link copied to clipboard
Link copied to clipboard

JSON Schema vendor extensions (x-*) carried verbatim from the payload.

Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toJsonValue(): JsonValue

Returns the objects represented as a JsonValue.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun validate(json: JsonValue)

Validates that json conforms to this schema.