jsonschemax

package
v0.0.82 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONPointerToDotNotation added in v0.0.82

func JSONPointerToDotNotation(pointer string) string

JSONPointerToDotNotation converts JSON Pointer "#/foo/bar" to dot-notation "foo.bar".

Types

type Error added in v0.0.82

type Error struct {
	// Type is the error type.
	Type ErrorType

	// DocumentPointer is the JSON Pointer in the document.
	DocumentPointer string

	// SchemaPointer is the JSON Pointer in the schema.
	SchemaPointer string

	// DocumentFieldName is a pointer to the document in dot-notation: fo.bar.baz
	DocumentFieldName string
}

Error represents a schema error.

func NewFromSanthoshError added in v0.0.82

func NewFromSanthoshError(validationError jsonschema.ValidationError) *Error

NewFromSanthoshError converts github.com/santhosh-tekuri/jsonschema.ValidationError to Error.

type ErrorType added in v0.0.82

type ErrorType int

ErrorType is the schema error type.

const (
	// ErrorTypeMissing represents a validation that failed because a value is missing.
	ErrorTypeMissing ErrorType = iota + 1
)

type Path

type Path struct {
	// Name is the JSON path name.
	Name string

	// Default is the default value of that path.
	Default interface{}

	// Type is a prototype (e.g. float64(0)) of the path type.
	Type interface{}
}

Path represents a JSON Schema Path.

func ListPaths

func ListPaths(ref string, compiler *jsonschema.Compiler) ([]Path, error)

ListPaths lists all paths of a JSON Schema. Will return an error if circular dependencies are found.

Directories

Path Synopsis
Package httploader implements loader.Loader for http/https url.
Package httploader implements loader.Loader for http/https url.

Jump to

Keyboard shortcuts

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