Versions in this module Expand all Collapse all v0 v0.0.1 Oct 6, 2024 Changes in this version + var ErrFailedToConvertToRat = errors.New("failed to convert string to *big.Rat") + var ErrFailedToDecodeSegmentWithJSONPointer = errors.New("failed to decode segment") + var ErrFailedToFetch = errors.New("failed to fetch from URL") + var ErrFailedToReadData = errors.New("failed to read data from URL") + var ErrFailedToResolveDefinitions = errors.New("failed to resolve definitions in $defs") + var ErrFailedToResolveGlobalReference = errors.New("failed to resolve global reference") + var ErrFailedToResolveItems = errors.New("failed to resolve items") + var ErrFailedToResolveReference = errors.New("failed to resolve reference") + var ErrIPv6AddressNotEnclosed = errors.New("ipv6 address is not enclosed in brackets") + var ErrInvalidHTTPStatusCode = errors.New("invalid HTTP status code returned") + var ErrInvalidIPv6Address = errors.New("invalid ipv6 address") + var ErrInvalidJSONSchemaType = errors.New("invalid JSON schema type") + var ErrJSONUnmarshalError = errors.New("json unmarshal error") + var ErrNoLoaderRegistered = errors.New("no loader registered for scheme") + var ErrSegmentNotFoundForJSONPointer = errors.New("segment not found in the schema context") + var ErrUnsupportedTypeForRat = errors.New("unsupported type for conversion to *big.Rat") + var ErrXMLUnmarshalError = errors.New("xml unmarshal error") + var Formats = map[string]func(interface{}) bool + func FormatRat(r *Rat) string + func GetI18n() (*i18n.I18n, error) + func IsDate(v interface{}) bool + func IsDateTime(v interface{}) bool + func IsDuration(v interface{}) bool + func IsEmail(v interface{}) bool + func IsHostname(v interface{}) bool + func IsIPV4(v interface{}) bool + func IsIPV6(v interface{}) bool + func IsJSONPointer(v interface{}) bool + func IsPeriod(v interface{}) bool + func IsRegex(v interface{}) bool + func IsRelativeJSONPointer(v interface{}) bool + func IsTime(v interface{}) bool + func IsURI(v interface{}) bool + func IsURIReference(v interface{}) bool + func IsURITemplate(v interface{}) bool + func IsUUID(v interface{}) bool + type Compiler struct + AssertFormat bool + Decoders map[string]func(string) ([]byte, error) + DefaultBaseURI string + Loaders map[string]func(url string) (io.ReadCloser, error) + MediaTypes map[string]func([]byte) (interface{}, error) + func NewCompiler() *Compiler + func (c *Compiler) Compile(jsonSchema []byte, uris ...string) (*Schema, error) + func (c *Compiler) GetSchema(ref string) (*Schema, error) + func (c *Compiler) RegisterDecoder(encodingName string, decoderFunc func(string) ([]byte, error)) *Compiler + func (c *Compiler) RegisterLoader(scheme string, loaderFunc func(url string) (io.ReadCloser, error)) *Compiler + func (c *Compiler) RegisterMediaType(mediaTypeName string, unmarshalFunc func([]byte) (interface{}, error)) *Compiler + func (c *Compiler) SetAssertFormat(assert bool) *Compiler + func (c *Compiler) SetDefaultBaseURI(baseURI string) *Compiler + func (c *Compiler) SetSchema(uri string, schema *Schema) *Compiler + type ConstValue struct + IsSet bool + Value interface{} + func (cv *ConstValue) UnmarshalJSON(data []byte) error + func (cv ConstValue) MarshalJSON() ([]byte, error) + type DynamicScope struct + func NewDynamicScope() *DynamicScope + func (ds *DynamicScope) IsEmpty() bool + func (ds *DynamicScope) LookupDynamicAnchor(anchor string) *Schema + func (ds *DynamicScope) Peek() *Schema + func (ds *DynamicScope) Pop() *Schema + func (ds *DynamicScope) Push(schema *Schema) + func (ds *DynamicScope) Size() int + type EvaluationError struct + func NewEvaluationError(keyword string, code string, message string, params ...map[string]interface{}) *EvaluationError + func (e *EvaluationError) Error() string + func (e *EvaluationError) Localize(localizer *i18n.Localizer) string + type EvaluationResult struct + Annotations map[string]interface{} + Details []*EvaluationResult + Errors map[string]*EvaluationError + EvaluationPath string + InstanceLocation string + SchemaLocation string + Valid bool + func NewEvaluationResult(schema *Schema) *EvaluationResult + func (e *EvaluationResult) AddAnnotation(keyword string, annotation interface{}) *EvaluationResult + func (e *EvaluationResult) AddDetail(detail *EvaluationResult) *EvaluationResult + func (e *EvaluationResult) AddError(err *EvaluationError) *EvaluationResult + func (e *EvaluationResult) CollectAnnotations() *EvaluationResult + func (e *EvaluationResult) IsValid() bool + func (e *EvaluationResult) SetEvaluationPath(evaluationPath string) *EvaluationResult + func (e *EvaluationResult) SetInstanceLocation(instanceLocation string) *EvaluationResult + func (e *EvaluationResult) SetInvalid() *EvaluationResult + func (e *EvaluationResult) SetSchemaLocation(location string) *EvaluationResult + func (e *EvaluationResult) ToFlag() *Flag + func (e *EvaluationResult) ToList(includeHierarchy ...bool) *List + func (e *EvaluationResult) ToLocalizeList(localizer *i18n.Localizer, includeHierarchy ...bool) *List + type Flag struct + Valid bool + type List struct + Annotations map[string]interface{} + Details []List + Errors map[string]string + EvaluationPath string + InstanceLocation string + SchemaLocation string + Valid bool + type Rat struct + func NewRat(value interface{}) *Rat + func (r *Rat) MarshalJSON() ([]byte, error) + func (r *Rat) UnmarshalJSON(data []byte) error + type Schema struct + AdditionalProperties *Schema + AllOf []*Schema + Anchor string + AnyOf []*Schema + Boolean *bool + Const *ConstValue + Contains *Schema + ContentEncoding *string + ContentMediaType *string + ContentSchema *Schema + Default interface{} + Defs map[string]*Schema + DependentRequired map[string][]string + DependentSchemas map[string]*Schema + Deprecated *bool + Description *string + DynamicAnchor string + DynamicRef string + Else *Schema + Enum []interface{} + Examples []interface{} + ExclusiveMaximum *Rat + ExclusiveMinimum *Rat + Format *string + ID string + If *Schema + Items *Schema + MaxContains *float64 + MaxItems *float64 + MaxLength *float64 + MaxProperties *float64 + Maximum *Rat + MinContains *float64 + MinItems *float64 + MinLength *float64 + MinProperties *float64 + Minimum *Rat + MultipleOf *Rat + Not *Schema + OneOf []*Schema + Pattern *string + PatternProperties *SchemaMap + PrefixItems []*Schema + Properties *SchemaMap + PropertyNames *Schema + ReadOnly *bool + Ref string + Required []string + ResolvedDynamicRef *Schema + ResolvedRef *Schema + Schema string + Then *Schema + Title *string + Type SchemaType + UnevaluatedItems *Schema + UnevaluatedProperties *Schema + UniqueItems *bool + WriteOnly *bool + func (s *Schema) GetSchemaLocation(anchor string) string + func (s *Schema) GetSchemaURI() string + func (s *Schema) MarshalJSON() ([]byte, error) + func (s *Schema) UnmarshalJSON(data []byte) error + func (s *Schema) Validate(instance interface{}) *EvaluationResult + type SchemaMap map[string]*Schema + func (sm *SchemaMap) UnmarshalJSON(data []byte) error + func (sm SchemaMap) MarshalJSON() ([]byte, error) + type SchemaType []string + func (r *SchemaType) UnmarshalJSON(data []byte) error + func (r SchemaType) MarshalJSON() ([]byte, error)