Documentation
¶
Index ¶
Constants ¶
const ( // BuiltinSchemaName names the builtin schema for Load()/Set(). BuiltinSchemaName = "builtin" // NoneSchemaName names the NOP-schema for Load()/Set(). NoneSchemaName = "none" )
Variables ¶
This section is empty.
Functions ¶
func ReadAndValidate ¶
ReadAndValidate all data from the given reader, using the active schema for validation.
func ValidateData ¶
ValidateData validates the given JSON document against the active schema.
func ValidateFile ¶
ValidateFile validates the given JSON file against the active schema.
func ValidateType ¶
func ValidateType(obj interface{}) error
ValidateType validates a go object against the schema.
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is a JSON validation schema.
func BuiltinSchema ¶
func BuiltinSchema() *Schema
BuiltinSchema returns the builtin schema if we have a valid one. Otherwise it falls back to NopSchema().
func NopSchema ¶
func NopSchema() *Schema
NopSchema returns an validating JSON Schema that does no real validation.
func (*Schema) ReadAndValidate ¶
ReadAndValidate all data from the given reader, using the schema for validation.
func (*Schema) ValidateData ¶
ValidateData validates the given JSON data against the schema.
func (*Schema) ValidateFile ¶
ValidateFile validates the given JSON file against the schema.
func (*Schema) ValidateType ¶
ValidateType validates a go object against the schema.