jsonschema

package
v0.0.1-alpha.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	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"
)

JSON Schema Keys

View Source
const (
	TypeArray   = "array"
	TypeObject  = "object"
	TypeInteger = "integer"
	TypeNumber  = "number"
	TypeBoolean = "boolean"
	TypeString  = "string"
)

JSON Schema Type Values

Variables

This section is empty.

Functions

func GenerateSchema

func GenerateSchema(t reflect.Type) map[string]interface{}

GenerateSchema produces a JSON Schema as a map for a given Go type.

func GenerateSchemaRawMessage

func GenerateSchemaRawMessage(t reflect.Type) json.RawMessage

GenerateSchemaRawMessage returns a JSON schema as json.RawMessage.

func SchemaFrom

func SchemaFrom[T any]() json.RawMessage

SchemaFrom generates a JSON Schema for generic type T.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL