draft_201909

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	Version         string                 `json:"$schema,omitempty"`
	ID              string                 `json:"$id,omitempty"`
	Anchor          string                 `json:"$anchor,omitempty"`
	RecursiveAnchor string                 `json:"$recursiveAnchor,omitempty"`
	Ref             string                 `json:"$ref,omitempty"`
	RecursiveRef    string                 `json:"$recursiveRef,omitempty"`
	Definitions     *orderedmap.OrderedMap `json:"$defs,omitempty"`
	Comments        string                 `json:"$comment,omitempty"`

	AllOf []*Schema `json:"allOf,omitempty"`
	AnyOf []*Schema `json:"anyOf,omitempty"`
	OneOf []*Schema `json:"oneOf,omitempty"`
	Not   *Schema   `json:"not,omitempty"`

	If               *Schema                `json:"if,omitempty"`
	Then             *Schema                `json:"then,omitempty"`
	Else             *Schema                `json:"else,omitempty"`
	DependentSchemas *orderedmap.OrderedMap `json:"dependentSchemas,omitempty"`

	PrefixItems []*Schema `json:"items,omitempty"`
	Items       *Schema   `json:"additionalItems,omitempty"`
	Contains    *Schema   `json:"contains,omitempty"`

	Properties           *orderedmap.OrderedMap `json:"properties,omitempty"`
	PatternProperties    *orderedmap.OrderedMap `json:"patternProperties,omitempty"`
	AdditionalProperties *Schema                `json:"additionalProperties,omitempty"`
	PropertyNames        *Schema                `json:"propertyNames,omitempty"`

	Type              string              `json:"type,omitempty"`
	Enum              []any               `json:"enum,omitempty"`
	Const             *any                `json:"const,omitempty"`
	MultipleOf        *int                `json:"multipleOf,omitempty"`
	Maximum           *float64            `json:"maximum,omitempty"`
	ExclusiveMaximum  *float64            `json:"exclusiveMaximum,omitempty"`
	Minimum           *float64            `json:"minimum,omitempty"`
	ExclusiveMinimum  *float64            `json:"exclusiveMinimum,omitempty"`
	MaxLength         *int                `json:"maxLength,omitempty"`
	MinLength         *int                `json:"minLength,omitempty"`
	Pattern           string              `json:"pattern,omitempty"`
	MaxItems          *int                `json:"maxItems,omitempty"`
	MinItems          *int                `json:"minItems,omitempty"`
	UniqueItems       *bool               `json:"uniqueItems,omitempty"`
	MaxContains       *int                `json:"maxContains,omitempty"`
	MinContains       *int                `json:"minContains,omitempty"`
	MaxProperties     *int                `json:"maxProperties,omitempty"`
	MinProperties     *int                `json:"minProperties,omitempty"`
	Required          []string            `json:"required,omitempty"`
	DependentRequired map[string][]string `json:"dependentRequired,omitempty"`

	Format string `json:"format,omitempty"`

	ContentEncoding  string  `json:"contentEncoding,omitempty"`
	ContentMediaType string  `json:"contentMediaType,omitempty"`
	ContentSchema    *Schema `json:"contentSchema,omitempty"`

	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Default     *any   `json:"default,omitempty"`
	Deprecated  *bool  `json:"deprecated,omitempty"`
	ReadOnly    *bool  `json:"readOnly,omitempty"`
	WriteOnly   *bool  `json:"writeOnly,omitempty"`
	Examples    []any  `json:"examples,omitempty"`

	Extras map[string]any `json:"-"`
}

func New

func New(schema *jsonschema.Schema) *Schema

Jump to

Keyboard shortcuts

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