JsonSchemaGenerator
object JsonSchemaGenerator
Walks a kotlinx.serialization SerialDescriptor and produces a JSON Schema (draft 2020-12-ish subset) suitable for handing to LLM provider APIs.
Supported descriptors:
Primitives →
type: "string|number|integer|boolean"Classes / objects →
type: "object"withpropertiesandrequiredLists →
type: "array"withitemsMaps →
type: "object"withadditionalPropertiesEnums →
type: "string"withenum
Sealed and open polymorphic descriptors fall back to {} (any). Phase 1 does not need them; revisit when adding richer structured-output use cases.