Versions in this module Expand all Collapse all v0 v0.1.2 Jul 26, 2022 Changes in this version + type NamedValue struct + Name string v0.1.1 Dec 26, 2021 Changes in this version type Schema + func (s *Schema) GetUnknown(name string) (*Value, error) + func (s *Schema) SetUnknown(name string, val *Value) error type Value + func (v Value) Raw() []byte v0.1.0 Dec 13, 2021 Changes in this version + func NewStringPtr(b []byte) *string + func Validate(jsonDoc []byte) (bool, error) + type Dependencies map[string]*Dependency + func NewDependencies(jsonVal []byte, vt jsonparser.ValueType, parentSchema *Schema) (*Dependencies, error) + func (d Dependencies) MarshalJSON() ([]byte, error) + type Dependency struct + Schema *Schema + Strings *Strings + func NewDependency(jsonVal []byte, vt jsonparser.ValueType, parentSchema *Schema) (*Dependency, error) + func (i Dependency) MarshalJSON() ([]byte, error) + type Enum []*Value + func NewEnum(jsonVal []byte, vt jsonparser.ValueType) (*Enum, error) + func (e Enum) MarshalJSON() ([]byte, error) + type Items struct + Boolean *bool + Schema *Schema + Schemas *Schemas + func NewItems(jsonVal []byte, vt jsonparser.ValueType, parentSchema *Schema) (*Items, error) + func (i Items) MarshalJSON() ([]byte, error) + type NamedProperty struct + Name string + Property *Schema + type Properties []*NamedProperty + func NewProperties(jsonVal []byte, vt jsonparser.ValueType, parentSchema *Schema) (*Properties, error) + func (p Properties) GetProperty(name string) (*NamedProperty, bool) + func (p Properties) MarshalJSON() ([]byte, error) + type Ref struct + Schema *Schema + String *string + func NewRef(jsonVal []byte, vt jsonparser.ValueType, parentSchema *Schema) (*Ref, error) + func (r Ref) MarshalJSON() ([]byte, error) + type Schema struct + AdditionalItems *Schema + AdditionalProperties *Schema + AllOf *Schemas + AnyOf *Schemas + Comment *string + Const *Value + Contains *Schema + ContentEncoding *string + ContentMediaType *string + Default *Value + Definitions *Properties + Dependencies *Dependencies + Description *string + Else *Schema + Enum *Enum + Examples *Values + ExclusiveMaximum *Value + ExclusiveMinimum *Value + Format *string + ID *string + IDDraft04 *string + If *Schema + Items *Items + MaxItems *int64 + MaxLength *int64 + MaxProperties *int64 + Maximum *Value + MinItems *int64 + MinLength *int64 + MinProperties *int64 + Minimum *Value + MultipleOf *json.Number + Not *Schema + OneOf *Schemas + Pattern *string + PatternProperties *Properties + Properties *Properties + PropertyNames *Schema + ReadOnly *bool + Ref *Ref + Required *Strings + Schema *string + Then *Schema + Title *string + Type *Type + UniqueItems *bool + WriteOnly *bool + var Draft04Schema *Schema + var Draft06Schema *Schema + var Draft07Schema *Schema + func New(schema []byte) (*Schema, error) + func NewFromString(schema string) (*Schema, error) + func (s *Schema) AddSchema(schema *Schema) error + func (s *Schema) AddSchemaString(schemaString string) error + func (s *Schema) DeRef() error + func (s *Schema) ExpandURI(uri string) (*url.URL, error) + func (s *Schema) Parse(jsonSchema []byte) (*Schema, error) + func (s *Schema) ResolveRef(ref *Ref) (*Schema, error) + func (s *Schema) SetCircularRefThresHold(threshold int) + func (s *Schema) SetID(id string) + func (s *Schema) UnmarshalJSON(schema []byte) error + func (s *Schema) Validate(jsonDoc []byte) (bool, error) + func (s Schema) GetID() string + func (s Schema) IsDraft4() bool + func (s Schema) IsDraft6() bool + func (s Schema) IsDraft7() bool + func (s Schema) IsEmpty() bool + func (s Schema) MarshalJSON() ([]byte, error) + func (s Schema) Pretty() string + func (s Schema) String() string + type SchemaProp uint8 + const PropAdditionalItems + const PropAdditionalProperties + const PropAllOf + const PropAnyOf + const PropComment + const PropConst + const PropContains + const PropContentEncoding + const PropContentMediaType + const PropDefault + const PropDefinitions + const PropDependencies + const PropDescription + const PropElse + const PropEnum + const PropExamples + const PropExclusiveMaximum + const PropExclusiveMinimum + const PropFormat + const PropID + const PropIDDraft04 + const PropIf + const PropItems + const PropMaxItems + const PropMaxLength + const PropMaxProperties + const PropMaximum + const PropMinItems + const PropMinLength + const PropMinProperties + const PropMinimum + const PropMultipleOf + const PropNot + const PropOneOf + const PropPattern + const PropPatternProperties + const PropProperties + const PropPropertyNames + const PropReadOnly + const PropRef + const PropRequired + const PropSchema + const PropThen + const PropTitle + const PropType + const PropUniqueItems + const PropWriteOnly + type Schemas []*Schema + func NewSubSchemas(jsonVal []byte, vt jsonparser.ValueType, parentSchema *Schema) (*Schemas, error) + func (s Schemas) MarshalJSON() ([]byte, error) + type Strings []*string + func NewStrings(jsonVal []byte, vt jsonparser.ValueType) (*Strings, error) + func (p Strings) MarshalJSON() ([]byte, error) + type Type struct + String *string + Strings *[]*string + func NewType(jsonVal []byte, vt jsonparser.ValueType) (*Type, error) + func (t *Type) Has(vt ValueType) bool + func (t Type) MarshalJSON() ([]byte, error) + type Value struct + Array *[]interface{} + Boolean *bool + Null *bool + Number *big.Float + Object *map[string]interface{} + String *string + func NewValue(jsonVal []byte, vt jsonparser.ValueType) (*Value, error) + func (v *Value) Equal(val *Value) bool + func (v Value) MarshalJSON() ([]byte, error) + type ValueType uint8 + const Array + const Boolean + const Integer + const NotExist + const Null + const Number + const Object + const String + const Unknown + func DetectJSONType(data []byte) ValueType + func (v ValueType) ParserValueType() jsonparser.ValueType + func (v ValueType) String() string + type Values []*Value + func NewValues(jsonVal []byte, vt jsonparser.ValueType) (*Values, error) + func (v Values) MarshalJSON() ([]byte, error)