Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Atomic ¶
type Atomic string
Atomic represents primitive types: string, integer, boolean, float.
type Custom ¶
type Custom string
Custom represents a reference to a user-defined type. At parse time, this type is unvalidated - the name may not exist in the type registry. Resolution happens later when Schema() is called with a Resolver that has the custom types loaded. If the type doesn't exist, Schema() will return an error from the Resolver.
type Map ¶
type Map struct {
Value Type
}
Map represents a map type: map[string]V. we do not support non-string keys in maps.
type Object ¶
type Object struct{}
Object represents a schemaless object with unknown fields preserved.
type Resolver ¶
type Resolver interface {
// Resolve returns the OpenAPI schema for a custom type by name.
// Returns an error if the type is not found.
Resolve(name string) (*extv1.JSONSchemaProps, error)
}
Resolver resolves custom type names to their schemas. It is used by Type.Schema to look up user-defined types during schema generation.
type Type ¶
type Type interface {
// Deps returns the names of custom types this type depends on.
// Used for topological sorting when loading custom types.
// Returns nil for types with no dependencies (e.g., atomics).
Deps() []string
// Schema generates the OpenAPI JSONSchemaProps for this type.
// The resolver is used to look up custom type schemas.
Schema(Resolver) (*extv1.JSONSchemaProps, error)
}
Type represents a parsed SimpleSchema type that can provide dependencies and build OpenAPI schemas. Implementations include Atomic (primitives), Slice, Map (collections), Object, Struct, and Custom (user-defined types).