Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IR ¶
type IR struct {
Schema *jsonschema.Schema
Types []IRType
}
type IRConstraints ¶
type IRConstraints struct {
// String constraints
MinLength *int
MaxLength *int
Pattern string
// Numeric constraints
Minimum *float64
Maximum *float64
ExclusiveMinimum *float64
ExclusiveMaximum *float64
MultipleOf *float64
// Array constraints
MinItems *int
MaxItems *int
UniqueItems bool
}
IRConstraints holds JSON Schema validation constraints. These are captured in the IR so generators can emit validation code (e.g., Zod .min()/.max(), Pydantic Field constraints).
type IRDefault ¶
type IRDefault struct {
RawValue string // The raw JSON value as a string (e.g., "1", "\"hello\"", "true")
Builtin IRBuiltin // The type of the default value for type-aware rendering
}
IRDefault represents a default value for a field from the JSON Schema "default" keyword.
type IRDiscriminatedUnion ¶
type IREnumValue ¶
type IREnumValue struct {
StringValue string // The string representation (for string enums or as name for int enums)
IntValue *int // The integer value (for int enums)
IsNull bool // Whether this is a null value
}
IREnumValue represents a single enum value with type information
type IRType ¶
type IRType struct {
Name string
Description string
Kind IRTypeKind
BaseType string // Name of the base type this extends (from allOf $ref composition)
Fields []IRField
Element *IRTypeRef
KeyType *IRTypeRef
Enum []string // String enum values (backwards compatible)
EnumValues []IREnumValue // Typed enum values (supports int, string, null)
EnumType IRBuiltin // The underlying type of the enum (string, int)
Union *IRDiscriminatedUnion // For discriminated unions (oneOf with discriminator)
SimpleUnion *IRUnion // For non-discriminated unions (oneOf/anyOf without discriminator)
}
type IRTypeKind ¶
type IRTypeKind string
const ( IRKindStruct IRTypeKind = "struct" IRKindAlias IRTypeKind = "alias" IRKindEnum IRTypeKind = "enum" IRKindDiscriminatedUnion IRTypeKind = "discriminated_union" IRKindUnion IRTypeKind = "union" // Non-discriminated union (oneOf/anyOf without discriminator) )
Click to show internal directories.
Click to hide internal directories.