Documentation ¶
Overview ¶
Package schema contains code for working with JSON schema.
Index ¶
- func MisspelledOptionalPropertyFound(validationResult ValidationResult) bool
- func ProhibitedAdditionalProperties(propertyName string, validationResult ValidationResult) bool
- func PropertyDependenciesMissing(propertyName string, validationResult ValidationResult) bool
- func PropertyEnumMismatch(propertyName string, validationResult ValidationResult) bool
- func PropertyFormatMismatch(propertyName string, validationResult ValidationResult) bool
- func PropertyGreaterThanMaxLength(propertyName string, validationResult ValidationResult) bool
- func PropertyLessThanMinLength(propertyName string, validationResult ValidationResult) bool
- func PropertyPatternMismatch(propertyName string, validationResult ValidationResult) bool
- func PropertyTypeMismatch(propertyName string, validationResult ValidationResult) bool
- func RequiredPropertyMissing(propertyName string, validationResult ValidationResult) bool
- func ValidationErrorMatch(instancePointerQuery, schemaPointerQuery, schemaPointerValueQuery, ... string, ...) bool
- type Schema
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MisspelledOptionalPropertyFound ¶
func MisspelledOptionalPropertyFound(validationResult ValidationResult) bool
MisspelledOptionalPropertyFound returns whether a misspelled optional property was found.
func ProhibitedAdditionalProperties ¶
func ProhibitedAdditionalProperties(propertyName string, validationResult ValidationResult) bool
ProhibitedAdditionalProperties returns whether the given property has prohibited additional subproperty(s).
func PropertyDependenciesMissing ¶
func PropertyDependenciesMissing(propertyName string, validationResult ValidationResult) bool
PropertyDependenciesMissing returns whether property dependencies of the given property are missing.
func PropertyEnumMismatch ¶
func PropertyEnumMismatch(propertyName string, validationResult ValidationResult) bool
PropertyEnumMismatch returns whether the given property does not match any of the items in the enum array.
func PropertyFormatMismatch ¶
func PropertyFormatMismatch(propertyName string, validationResult ValidationResult) bool
PropertyFormatMismatch returns whether the given property has incorrect format.
func PropertyGreaterThanMaxLength ¶
func PropertyGreaterThanMaxLength(propertyName string, validationResult ValidationResult) bool
PropertyGreaterThanMaxLength returns whether the given property is greater than the maximum length allowed by the schema.
func PropertyLessThanMinLength ¶
func PropertyLessThanMinLength(propertyName string, validationResult ValidationResult) bool
PropertyLessThanMinLength returns whether the given property is less than the minimum length allowed by the schema.
func PropertyPatternMismatch ¶
func PropertyPatternMismatch(propertyName string, validationResult ValidationResult) bool
PropertyPatternMismatch returns whether the given property did not match the regular expression defined in the JSON schema.
func PropertyTypeMismatch ¶
func PropertyTypeMismatch(propertyName string, validationResult ValidationResult) bool
PropertyTypeMismatch returns whether the given property has incorrect type.
func RequiredPropertyMissing ¶
func RequiredPropertyMissing(propertyName string, validationResult ValidationResult) bool
RequiredPropertyMissing returns whether the given required property is missing from the document.
func ValidationErrorMatch ¶
func ValidationErrorMatch( instancePointerQuery, schemaPointerQuery, schemaPointerValueQuery, failureContextQuery string, validationResult ValidationResult, ) bool
ValidationErrorMatch returns whether the given query matches against the JSON schema validation error. See: https://godoc.org/github.com/ory/jsonschema#ValidationError
Types ¶
type Schema ¶
type Schema struct { Compiled *jsonschema.Schema // contains filtered or unexported fields }
Schema is the type of the compiled JSON schema object.
type ValidationResult ¶
type ValidationResult struct { Result *jsonschema.ValidationError // contains filtered or unexported fields }
ValidationResult is the type of the result of the validation of the instance document against the JSON schema.
func Validate ¶
func Validate(instanceInterface map[string]interface{}, schemaObject Schema) ValidationResult
Validate validates an instance against a JSON schema and returns nil if it was success, or the jsonschema.ValidationError object otherwise.
Directories ¶
Path | Synopsis |
---|---|
Package compliancelevel defines the levels of specification compliance.
|
Package compliancelevel defines the levels of specification compliance. |
Package schemadata Code generated by go-bindata.
|
Package schemadata Code generated by go-bindata. |