jsonschema

package
v0.0.0-...-60f5d5a Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

Compile caches JSON schema compilation

func MapError

func MapError(result *gojsonschema.Result) error

func Validate

func Validate(schema *SchemaWithReferences, data interface{}) (*gojsonschema.Result, error)

func ValidateJSON

func ValidateJSON(schema *SchemaWithReferences, document []byte) error

Utility functions

Types

type Schema

type Schema struct {
	LocationRoot string
	Location     string
	Name         string
}

Schema -

func (Schema) GetFullPath

func (s Schema) GetFullPath() string

func (Schema) GetLocation

func (s Schema) GetLocation() string

type SchemaWithReferences

type SchemaWithReferences struct {
	Main       Schema
	References []Schema
}

SchemaWithReferences -

func ResolveSchemaLocation

func ResolveSchemaLocation(location string, cfg *SchemaWithReferences) *SchemaWithReferences

func ResolveSchemaLocationRoot

func ResolveSchemaLocationRoot(root string, cfg *SchemaWithReferences) *SchemaWithReferences

ResolveSchemaLocationRoot resolved the LocationRoot of the Main and all References schemas

func (SchemaWithReferences) GetReferencesFullPaths

func (s SchemaWithReferences) GetReferencesFullPaths() []string

func (SchemaWithReferences) IsEmpty

func (s SchemaWithReferences) IsEmpty() bool

Jump to

Keyboard shortcuts

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