Documentation ¶
Index ¶
- func Contains(field string, required []string) bool
- func Format(field interface{}) string
- func JSONBytesEqual(a, b []byte) (bool, error)
- func Type(field interface{}) string
- func Validate(schema, document string) error
- func ValidateJSONSchema(maybeSchema JSONSchemaMap) error
- type JSONSchemaMap
- type Properties
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONBytesEqual ¶
JSONBytesEqual compares the JSON in two byte slices for deep equality, ignoring whitespace and other non-semantically meaningful formatting differences.
func Validate ¶
Validate exists to hide gojsonschema logic within this file it is the entry-point to validation logic, requiring the caller pass in valid json strings for each argument
func ValidateJSONSchema ¶
func ValidateJSONSchema(maybeSchema JSONSchemaMap) error
ValidateJSONSchema takes in a string that is purported to be a JSON schema (schema definition) An error is returned if it is not a valid JSON schema, and nil is returned on success
Types ¶
type JSONSchemaMap ¶
type JSONSchemaMap map[string]interface{}
go representation of json schema document
func (JSONSchemaMap) AllowsAdditionalProperties ¶
func (j JSONSchemaMap) AllowsAdditionalProperties() bool
func (JSONSchemaMap) Description ¶
func (j JSONSchemaMap) Description() string
Assumes the json schema has a description field
func (JSONSchemaMap) Properties ¶
func (j JSONSchemaMap) Properties() Properties
Assumes the json schema has a properties field
func (JSONSchemaMap) RequiredFields ¶
func (j JSONSchemaMap) RequiredFields() []string
func (JSONSchemaMap) ToJSON ¶
func (j JSONSchemaMap) ToJSON() string
type Properties ¶
type Properties map[string]interface{}
Click to show internal directories.
Click to hide internal directories.