Documentation
¶
Index ¶
- Constants
- func GenerateSchema(t reflect.Type) map[string]any
- func GenerateSchemaRawMessage(t reflect.Type) json.RawMessage
- func GenerateSchemaWithComponents(t reflect.Type) map[string]any
- func GetComponents() map[string]any
- func RegisterComponent(name string, schema map[string]any)
- func RegisterSchema(t reflect.Type, schema map[string]any)
- func SchemaFrom[T any]() json.RawMessage
Constants ¶
View Source
const ( // Schema keywords TypeKey = "type" PropertiesKey = "properties" RequiredKey = "required" ItemsKey = "items" AdditionalPropertiesKey = "additionalProperties" RefKey = "$ref" MinimumKey = "minimum" MaximumKey = "maximum" MultipleOfKey = "multipleOf" MinLengthKey = "minLength" MaxLengthKey = "maxLength" PatternKey = "pattern" FormatKey = "format" MinItemsKey = "minItems" MaxItemsKey = "maxItems" UniqueItemsKey = "uniqueItems" EnumKey = "enum" TitleKey = "title" DescriptionKey = "description" DefaultKey = "default" OneOfKey = "oneOf" AnyOfKey = "anyOf" AllOfKey = "allOf" NotKey = "not" DataSourceKey = "dataSource" ComponentIDKey = "componentId" DependencyIDKey = "dependencyId" PositionKey = "position" JSONTag = "json" // Schema types TypeArray = "array" TypeObject = "object" TypeInteger = "integer" TypeNumber = "number" TypeBoolean = "boolean" TypeString = "string" )
JSON Schema constants for keys and types.
Variables ¶
This section is empty.
Functions ¶
func GenerateSchemaRawMessage ¶
func GenerateSchemaRawMessage(t reflect.Type) json.RawMessage
GenerateSchemaRawMessage returns a JSON Schema as a raw JSON message.
func GetComponents ¶
func RegisterComponent ¶
func RegisterSchema ¶
RegisterSchema registers a custom JSON Schema for a Go type.
func SchemaFrom ¶
func SchemaFrom[T any]() json.RawMessage
SchemaFrom generates a JSON Schema for a generic type T.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.