pkg

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJsonSchema

func GenerateJsonSchema(config *Config) error

Generate JSON schema

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Save values of parsed flags in Config

func ParseFlags

func ParseFlags(progname string, args []string) (config *Config, output string, err error)

Parse flags

type Schema

type Schema struct {
	Type              interface{}        `json:"type,omitempty"`
	Enum              []any              `json:"enum,omitempty"`
	MultipleOf        *float64           `json:"multipleOf,omitempty"`
	Maximum           *float64           `json:"maximum,omitempty"`
	Minimum           *float64           `json:"minimum,omitempty"`
	MaxLength         *uint64            `json:"maxLength,omitempty"`
	MinLength         *uint64            `json:"minLength,omitempty"`
	Pattern           string             `json:"pattern,omitempty"`
	MaxItems          *uint64            `json:"maxItems,omitempty"`
	MinItems          *uint64            `json:"minItems,omitempty"`
	UniqueItems       bool               `json:"uniqueItems,omitempty"`
	MaxProperties     *uint64            `json:"maxProperties,omitempty"`
	MinProperties     *uint64            `json:"minProperties,omitempty"`
	PatternProperties interface{}        `json:"patternProperties,omitempty"`
	Required          []string           `json:"required,omitempty"`
	Items             *Schema            `json:"items,omitempty"`
	Properties        map[string]*Schema `json:"properties,omitempty"`
	Title             string             `json:"title,omitempty"`
	Description       string             `json:"description,omitempty"`
	ReadOnly          bool               `json:"readOnly,omitempty"`
	Default           interface{}        `json:"default,omitempty"`
}

Jump to

Keyboard shortcuts

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