Package-level declarations

Types

Link copied to clipboard

How a property default behaves relative to required-ness.

Link copied to clipboard
data class Discriminator(val name: String, val required: Boolean, val mapping: Map<String, TypeId>? = null)

Class discriminator information. If mapping is null, default implicit mapping is assumed (typically discriminator value equals subtype serial name).

Link copied to clipboard
data class EnumNode(val name: String, val entries: List<String>, val description: String? = null) : TypeNode

Enum node with symbolic entries.

Link copied to clipboard

Utility object for annotation-based introspection, providing methods to process annotations, especially those related to descriptions.

Link copied to clipboard
data class ListNode(val element: TypeRef, val description: String? = null) : TypeNode

List/array node.

Link copied to clipboard
data class MapNode(val key: TypeRef, val value: TypeRef, val description: String? = null) : TypeNode

Map/dictionary node.

Link copied to clipboard
data class ObjectNode(val name: String, val properties: List<Property>, val required: Set<String>, val description: String? = null) : TypeNode

Object node with named properties and required set.

Link copied to clipboard
data class PolymorphicNode(val baseName: String, val subtypes: List<SubtypeRef>, val discriminator: Discriminator?, val description: String? = null) : TypeNode

Polymorphic node for sealed/open hierarchies.

Link copied to clipboard

Primitive kinds supported by the IR.

Link copied to clipboard
data class PrimitiveNode(val kind: PrimitiveKind, val description: String? = null) : TypeNode

Primitive node.

Link copied to clipboard
data class Property(val name: String, val type: TypeRef, val description: String? = null, val deprecated: Boolean = false, val defaultPresence: DefaultPresence = DefaultPresence.Absent, val annotations: Map<String, String?> = emptyMap())

Property of an object.

Link copied to clipboard

A facade for building TypeGraph from a particular source (e.g. KSP or Serialization).

Link copied to clipboard
data class SubtypeRef(val id: TypeId, val ref: TypeRef.Ref = TypeRef.Ref(id))

Reference to a subtype in a polymorphic hierarchy.

Link copied to clipboard
data class TypeGraph(val root: TypeRef, val nodes: Map<TypeId, TypeNode>)

A graph of discovered types plus the root type reference used to emit schemas.

Link copied to clipboard

Converts a TypeGraph intermediate representation to a target schema format.

Link copied to clipboard
data class TypeId(val value: String)

A stable identifier for a type definition used for deduplication and $ref linking.

Link copied to clipboard
sealed interface TypeNode

Base node for all kinds supported by the schema IR.

Link copied to clipboard
sealed interface TypeRef

Reference to a type: either inline node or reference by TypeId.