Documentation
¶
Index ¶
Constants ¶
const ( // BuiltinSchemaName references the builtin schema for Load()/Set(). BuiltinSchemaName = "builtin" // NoneSchemaName references a disabled/NOP schema for Load()/Set(). NoneSchemaName = "none" // DefaultSchemaName is the none schema. DefaultSchemaName = NoneSchemaName )
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 validating JSON Schema.
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.