jsonschema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const JsonSchemaFrontend puzzle.Frontend = "jsonschema"
View Source
const UZERO = uint(0)

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSchema

type JSONSchema struct {
	Schema string `json:"$schema"`
	Id     string `json:"$id,omitempty"`
	JSONSchemaEntry
}

func Generate

func Generate(c *puzzle.Config) (*JSONSchema, error)

type JSONSchemaEntry

type JSONSchemaEntry struct {
	Title                string                      `json:"title,omitempty"`
	Format               string                      `json:"format,omitempty"`
	Pattern              string                      `json:"pattern,omitempty"`
	ContentEncoding      string                      `json:"contentEncoding,omitempty"`
	Description          string                      `json:"description,omitempty"`
	Type                 string                      `json:"type,omitempty"`
	Properties           map[string]*JSONSchemaEntry `json:"properties,omitempty"`
	PatternProperties    map[string]*JSONSchemaEntry `json:"patternProperties,omitempty"`
	Required             []string                    `json:"required,omitempty"`
	Items                *JSONSchemaEntry            `json:"items,omitempty"`
	AdditionalProperties bool                        `json:"additionalProperties,omitempty"`
	OneOf                []*JSONSchemaEntry          `json:"oneOf,omitempty"`
	PropertyConstraint
}

type MinMax

type MinMax struct {
	Negative *uint64
	Positive *uint64
}

func (*MinMax) MarshalJSON

func (m *MinMax) MarshalJSON() ([]byte, error)

type PropertyConstraint

type PropertyConstraint struct {
	MinItems    *uint64 `json:"minItems,omitempty"`
	MaxItems    *uint64 `json:"maxItems,omitempty"`
	UniqueItems *bool   `json:"uniqueItems,omitempty"`
	Minimum     *MinMax `json:"minimum,omitempty"`
	Maximum     *MinMax `json:"maximum,omitempty"`
}

Jump to

Keyboard shortcuts

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