jsonschema

package
v0.0.0-...-b3e4aef Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string
const (
	NoFormat Format = ""

	DateTimeFormat            Format = "date-time"             // as defined by the "date-time" ABNF rule in RFC 3339
	DateFormat                Format = "date"                  // as defined by the "full-date" ABNF rule in RFC 3339
	TimeFormat                Format = "time"                  // as defined by the "full-time" ABNF rule in RFC 3339
	DurationFormat            Format = "duration"              // as defined by the "duration" ABNF rule in RFC 3339
	EmailFormat               Format = "email"                 // as defined by the "Mailbox" ABNF rule in RFC 5321
	IdnEmailFormat            Format = "idn-email"             // as defined by the "Mailbox" ABNF rule in RFC 5321 extended by RFC 6531
	Ipv4Format                Format = "ipv4"                  // as defined by the "dotted-quad" ABNF rule in RFC 2673
	Ipv6Format                Format = "ipv6"                  // as defined by RFC 4291
	UriFormat                 Format = "uri"                   // as defined by the "URI" ABNF rule in RFC 3986
	UriReferenceFormat        Format = "uri-reference"         // as defined by the "URI-reference" ABNF rule in RFC 3986
	IriFormat                 Format = "iri"                   // as defined by the "IRI" ABNF rule in RFC 3987
	IriReferenceFormat        Format = "iri-reference"         // as defined by the "IRI-reference" ABNF rule in RFC 3987
	UuidFormat                Format = "uuid"                  // as defined by the "UUID" ABNF rule in RFC 4122
	UriTemplateFormat         Format = "uri-template"          // as defined by the "URI-Template" ABNF rule in RFC 6570
	JsonPointerFormat         Format = "json-pointer"          // as defined by RFC 6901
	RelativeJsonPointerFormat Format = "relative-json-pointer" // as defined by RFC 6901
	RegexFormat               Format = "regex"                 // regular expression in the ECMA-262 dialect
)

type Keyword

type Keyword interface {
	Kind() Kind
	AppliesTo(t Type) bool
	Validate(v interface{}) error
}

type Kind

type Kind uint8
const (
	Identifier       Kind = 1 << iota // Control schema identification through setting a URI for the schema and/or changing how the base URI is determined
	ReservedLocation                  // Do not directly affect results, but reserve a place for a specific purpose to ensure interoperability
	Applicator                        // Apply one or more subschemas to a particular location in the instance, and combine or modify their results
	Annotation                        // Attach information to an instance for application use
	Assertion                         // Produce a boolean result when applied to an instance
)

func (Kind) Has

func (k Kind) Has(ands ...Kind) bool

func (Kind) Range

func (k Kind) Range() iter.Seq[Kind]

type Type

type Type uint8
const (
	NullType Type = 1 << iota
	IntegerType
	NumberType
	StringType
	BooleanType
	ObjectType
	ArrayType
)

func TypeOf

func TypeOf(v any) Type

func (Type) Has

func (t Type) Has(ands ...Type) bool

func (Type) MarshalJSON

func (t Type) MarshalJSON() ([]byte, error)

func (Type) Range

func (t Type) Range() iter.Seq[Type]

func (Type) String

func (t Type) String() string

func (*Type) UnmarshalJSON

func (t *Type) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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