Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONPointerToDotNotation ¶ added in v0.0.82
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 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{} // Format is the format of the path if defined Format string // Pattern is the pattern of the path if defined Pattern *regexp.Regexp // Enum are the allowed enum values Enum []interface{} // first element in slice is constant value. note: slice is used to capture nil constant. Constant []interface{} // Required is whether the value is required // TODO Required bool // -1 if not specified MinLength int MaxLength int Minimum *big.Float Maximum *big.Float MultipleOf *big.Float }
Path represents a JSON Schema Path.
func ListPaths ¶
ListPaths lists all paths of a JSON Schema. Will return an error if circular references are found.
func ListPathsBytes ¶
func ListPathsBytes(raw json.RawMessage, maxRecursion int16) ([]Path, error)
ListPathsBytes works like ListPathsWithRecursion but prepares the JSON Schema itself.
Directories ¶
Path | Synopsis |
---|---|
Package httploader implements loader.Loader for http/https url.
|
Package httploader implements loader.Loader for http/https url. |
Click to show internal directories.
Click to hide internal directories.