Versions in this module Expand all Collapse all v5 v5.4.2 Oct 30, 2023 v5.4.1 Oct 30, 2023 Changes in this version + var Decoders = map[string]func(string) ([]byte, error) + var Draft2019 = &Draft + var Draft2020 = &Draft + var Draft4 = &Draft + var Draft6 = &Draft + var Draft7 = &Draft + var Formats = map[string]func(interface{}) bool + var LoadURL = func(s string) (io.ReadCloser, error) + var Loaders = map[string]func(url string) (io.ReadCloser, error) + var MediaTypes = map[string]func([]byte) error + type Basic struct + Errors []BasicError + Valid bool + type BasicError struct + AbsoluteKeywordLocation string + Error string + InstanceLocation string + KeywordLocation string + type Compiler struct + AssertContent bool + AssertFormat bool + CompileRegex func(s string) (Regexp, error) + Decoders map[string]func(string) ([]byte, error) + Draft *Draft + ExtractAnnotations bool + Formats map[string]func(interface{}) bool + LoadURL func(s string) (io.ReadCloser, error) + MediaTypes map[string]func([]byte) error + func NewCompiler() *Compiler + func (c *Compiler) AddResource(url string, r io.Reader) error + func (c *Compiler) AddResourceJSON(url string, doc interface{}) error + func (c *Compiler) Compile(url string) (*Schema, error) + func (c *Compiler) MustCompile(url string) *Schema + func (c *Compiler) RegisterExtension(name string, meta *Schema, ext ExtCompiler) + type CompilerContext struct + func (ctx CompilerContext) Compile(schPath string, applicableOnSameInstance bool) (*Schema, error) + func (ctx CompilerContext) CompileRef(ref string, refPath string, applicableOnSameInstance bool) (*Schema, error) + type Detailed struct + AbsoluteKeywordLocation string + Error string + Errors []Detailed + InstanceLocation string + KeywordLocation string + Valid bool + type Draft struct + func (d *Draft) String() string + func (d *Draft) URL() string + type ExtCompiler interface + Compile func(ctx CompilerContext, m map[string]interface{}) (ExtSchema, error) + type ExtSchema interface + Validate func(ctx ValidationContext, v interface{}) error + type Flag struct + Valid bool + type InfiniteLoopError string + func (e InfiniteLoopError) Error() string + type InvalidJSONTypeError string + func (e InvalidJSONTypeError) Error() string + type LoaderNotFoundError string + func (e LoaderNotFoundError) Error() string + type Regexp interface + MatchString func(s string) bool + String func() string + type Schema struct + AdditionalItems interface{} + AdditionalProperties interface{} + AllOf []*Schema + Always *bool + AnyOf []*Schema + Comment string + Constant []interface{} + Contains *Schema + ContainsEval bool + ContentEncoding string + ContentMediaType string + ContentSchema *Schema + Default interface{} + Dependencies map[string]interface{} + DependentRequired map[string][]string + DependentSchemas map[string]*Schema + Deprecated bool + Description string + Draft *Draft + DynamicAnchor string + DynamicRef *Schema + Else *Schema + Enum []interface{} + Examples []interface{} + ExclusiveMaximum *big.Rat + ExclusiveMinimum *big.Rat + Extensions map[string]ExtSchema + Format string + If *Schema + Items interface{} + Items2020 *Schema + Location string + MaxContains int + MaxItems int + MaxLength int + MaxProperties int + Maximum *big.Rat + MinContains int + MinItems int + MinLength int + MinProperties int + Minimum *big.Rat + MultipleOf *big.Rat + Not *Schema + OneOf []*Schema + Pattern Regexp + PatternProperties map[Regexp]*Schema + PrefixItems []*Schema + Properties map[string]*Schema + PropertyNames *Schema + ReadOnly bool + RecursiveAnchor bool + RecursiveRef *Schema + Ref *Schema + RegexProperties bool + Required []string + Then *Schema + Title string + Types []string + UnevaluatedItems *Schema + UnevaluatedProperties *Schema + UniqueItems bool + WriteOnly bool + func Compile(url string) (*Schema, error) + func CompileString(url, schema string) (*Schema, error) + func MustCompile(url string) *Schema + func MustCompileString(url, schema string) *Schema + func (s *Schema) String() string + func (s *Schema) Validate(v interface{}) (err error) + type SchemaError struct + Err error + SchemaURL string + func (se *SchemaError) Error() string + func (se *SchemaError) GoString() string + func (se *SchemaError) Unwrap() error + type ValidationContext struct + func (ctx ValidationContext) Error(keywordPath string, msg fmt.Stringer) *ValidationError + func (ctx ValidationContext) EvaluatedItem(index int) + func (ctx ValidationContext) EvaluatedProp(prop string) + func (ctx ValidationContext) Validate(s *Schema, spath string, v interface{}, vpath string) error + type ValidationError struct + AbsoluteKeywordLocation string + Causes []*ValidationError + InstanceLocation string + KeywordLocation string + Message fmt.Stringer + func (ValidationError) Group(parent *ValidationError, causes ...error) error + func (ve *ValidationError) BasicOutput() Basic + func (ve *ValidationError) DetailedOutput() Detailed + func (ve *ValidationError) Error() string + func (ve *ValidationError) FlagOutput() Flag + func (ve *ValidationError) GoString() string