Documentation
¶
Index ¶
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 GenerateSchema ¶
GenerateSchema creates a JSON Schema for a given Go type.
func GenerateSchemaRawMessage ¶
func GenerateSchemaRawMessage(t reflect.Type) json.RawMessage
GenerateSchemaRawMessage returns a JSON Schema as a raw JSON message.
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.