gojsonschema: github.com/xeipuuv/gojsonschema Index | Files

package gojsonschema

import "github.com/xeipuuv/gojsonschema"

Index

Package Files

draft.go errors.go format_checkers.go internalLog.go jsonContext.go jsonLoader.go locales.go result.go schema.go schemaLoader.go schemaPool.go schemaReferencePool.go schemaType.go subSchema.go types.go utils.go validation.go

Constants

const (
    STRING_NUMBER                     = "number"
    STRING_ARRAY_OF_STRINGS           = "array of strings"
    STRING_ARRAY_OF_SCHEMAS           = "array of schemas"
    STRING_SCHEMA                     = "valid schema"
    STRING_SCHEMA_OR_ARRAY_OF_STRINGS = "schema or array of strings"
    STRING_PROPERTIES                 = "properties"
    STRING_DEPENDENCY                 = "dependency"
    STRING_PROPERTY                   = "property"
    STRING_UNDEFINED                  = "undefined"
    STRING_CONTEXT_ROOT               = "(root)"
    STRING_ROOT_SCHEMA_PROPERTY       = "(root)"
)
const (
    KEY_SCHEMA                = "$schema"
    KEY_ID                    = "id"
    KEY_ID_NEW                = "$id"
    KEY_REF                   = "$ref"
    KEY_TITLE                 = "title"
    KEY_DESCRIPTION           = "description"
    KEY_TYPE                  = "type"
    KEY_ITEMS                 = "items"
    KEY_ADDITIONAL_ITEMS      = "additionalItems"
    KEY_PROPERTIES            = "properties"
    KEY_PATTERN_PROPERTIES    = "patternProperties"
    KEY_ADDITIONAL_PROPERTIES = "additionalProperties"
    KEY_PROPERTY_NAMES        = "propertyNames"
    KEY_DEFINITIONS           = "definitions"
    KEY_MULTIPLE_OF           = "multipleOf"
    KEY_MINIMUM               = "minimum"
    KEY_MAXIMUM               = "maximum"
    KEY_EXCLUSIVE_MINIMUM     = "exclusiveMinimum"
    KEY_EXCLUSIVE_MAXIMUM     = "exclusiveMaximum"
    KEY_MIN_LENGTH            = "minLength"
    KEY_MAX_LENGTH            = "maxLength"
    KEY_PATTERN               = "pattern"
    KEY_FORMAT                = "format"
    KEY_MIN_PROPERTIES        = "minProperties"
    KEY_MAX_PROPERTIES        = "maxProperties"
    KEY_DEPENDENCIES          = "dependencies"
    KEY_REQUIRED              = "required"
    KEY_MIN_ITEMS             = "minItems"
    KEY_MAX_ITEMS             = "maxItems"
    KEY_UNIQUE_ITEMS          = "uniqueItems"
    KEY_CONTAINS              = "contains"
    KEY_CONST                 = "const"
    KEY_ENUM                  = "enum"
    KEY_ONE_OF                = "oneOf"
    KEY_ANY_OF                = "anyOf"
    KEY_ALL_OF                = "allOf"
    KEY_NOT                   = "not"
    KEY_IF                    = "if"
    KEY_THEN                  = "then"
    KEY_ELSE                  = "else"
)
const (
    TYPE_ARRAY   = `array`
    TYPE_BOOLEAN = `boolean`
    TYPE_INTEGER = `integer`
    TYPE_NUMBER  = `number`
    TYPE_NULL    = `null`
    TYPE_OBJECT  = `object`
    TYPE_STRING  = `string`
)

Variables

var (
    // Locale is the default locale to use
    // Library users can overwrite with their own implementation
    Locale locale = DefaultLocale{}

    // ErrorTemplateFuncs allows you to define custom template funcs for use in localization.
    ErrorTemplateFuncs template.FuncMap
)
var (
    // Formatters holds the valid formatters, and is a public variable
    // so library users can add custom formatters
    FormatCheckers = FormatCheckerChain{
        // contains filtered or unexported fields
    }
)
var JSON_TYPES []string
var SCHEMA_TYPES []string

func NewRawLoader Uses

func NewRawLoader(source interface{}) *jsonRawLoader

type AdditionalPropertyNotAllowedError Uses

type AdditionalPropertyNotAllowedError struct {
    ResultErrorFields
}

AdditionalPropertyNotAllowedError. ErrorDetails: property

type ArrayContainsError Uses

type ArrayContainsError struct {
    ResultErrorFields
}

ArrayContainsError. ErrorDetails:

type ArrayMaxItemsError Uses

type ArrayMaxItemsError struct {
    ResultErrorFields
}

ArrayMaxItemsError. ErrorDetails: max

type ArrayMaxPropertiesError Uses

type ArrayMaxPropertiesError struct {
    ResultErrorFields
}

ArrayMaxPropertiesError. ErrorDetails: max

type ArrayMinItemsError Uses

type ArrayMinItemsError struct {
    ResultErrorFields
}

ArrayMinItemsError. ErrorDetails: min

type ArrayMinPropertiesError Uses

type ArrayMinPropertiesError struct {
    ResultErrorFields
}

ArrayMinPropertiesError. ErrorDetails: min

type ArrayNoAdditionalItemsError Uses

type ArrayNoAdditionalItemsError struct {
    ResultErrorFields
}

ArrayNoAdditionalItemsError. ErrorDetails: -

type ConditionElseError Uses

type ConditionElseError struct {
    ResultErrorFields
}

ConditionElseError. ErrorDetails: -

type ConditionThenError Uses

type ConditionThenError struct {
    ResultErrorFields
}

ConditionThenError. ErrorDetails: -

type ConstError Uses

type ConstError struct {
    ResultErrorFields
}

ConstError. ErrorDetails: allowed

type DateFormatChecker Uses

type DateFormatChecker struct{}

func (DateFormatChecker) IsFormat Uses

func (f DateFormatChecker) IsFormat(input interface{}) bool

type DateTimeFormatChecker Uses

type DateTimeFormatChecker struct{}

DateTimeFormatChecker verifies date/time formats per RFC3339 5.6

Valid formats:

	Partial Time: HH:MM:SS
	Full Date: YYYY-MM-DD
	Full Time: HH:MM:SSZ-07:00
	Date Time: YYYY-MM-DDTHH:MM:SSZ-0700

Where
	YYYY = 4DIGIT year
	MM = 2DIGIT month ; 01-12
	DD = 2DIGIT day-month ; 01-28, 01-29, 01-30, 01-31 based on month/year
	HH = 2DIGIT hour ; 00-23
	MM = 2DIGIT ; 00-59
	SS = 2DIGIT ; 00-58, 00-60 based on leap second rules
	T = Literal
	Z = Literal

Note: Nanoseconds are also suported in all formats

http://tools.ietf.org/html/rfc3339#section-5.6

func (DateTimeFormatChecker) IsFormat Uses

func (f DateTimeFormatChecker) IsFormat(input interface{}) bool

type DefaultJSONLoaderFactory Uses

type DefaultJSONLoaderFactory struct {
}

func (DefaultJSONLoaderFactory) New Uses

func (d DefaultJSONLoaderFactory) New(source string) JSONLoader

type DefaultLocale Uses

type DefaultLocale struct{}

DefaultLocale is the default locale for this package

func (DefaultLocale) AdditionalPropertyNotAllowed Uses

func (l DefaultLocale) AdditionalPropertyNotAllowed() string

func (DefaultLocale) ArrayContains Uses

func (l DefaultLocale) ArrayContains() string

func (DefaultLocale) ArrayMaxItems Uses

func (l DefaultLocale) ArrayMaxItems() string

func (DefaultLocale) ArrayMaxProperties Uses

func (l DefaultLocale) ArrayMaxProperties() string

func (DefaultLocale) ArrayMinItems Uses

func (l DefaultLocale) ArrayMinItems() string

func (DefaultLocale) ArrayMinProperties Uses

func (l DefaultLocale) ArrayMinProperties() string

func (DefaultLocale) ArrayNoAdditionalItems Uses

func (l DefaultLocale) ArrayNoAdditionalItems() string

func (DefaultLocale) ArrayNotEnoughItems Uses

func (l DefaultLocale) ArrayNotEnoughItems() string

func (DefaultLocale) CannotBeGT Uses

func (l DefaultLocale) CannotBeGT() string

func (DefaultLocale) CannotBeUsedWithout Uses

func (l DefaultLocale) CannotBeUsedWithout() string

func (DefaultLocale) ConditionElse Uses

func (l DefaultLocale) ConditionElse() string

func (DefaultLocale) ConditionThen Uses

func (l DefaultLocale) ConditionThen() string

If/Else

func (DefaultLocale) Const Uses

func (l DefaultLocale) Const() string

func (DefaultLocale) DoesNotMatchFormat Uses

func (l DefaultLocale) DoesNotMatchFormat() string

func (DefaultLocale) DoesNotMatchPattern Uses

func (l DefaultLocale) DoesNotMatchPattern() string

func (DefaultLocale) Duplicated Uses

func (l DefaultLocale) Duplicated() string

func (DefaultLocale) Enum Uses

func (l DefaultLocale) Enum() string

func (DefaultLocale) ErrorFormat Uses

func (l DefaultLocale) ErrorFormat() string

Replacement options: field, description, context, value

func (DefaultLocale) GreaterThanZero Uses

func (l DefaultLocale) GreaterThanZero() string

func (DefaultLocale) HttpBadStatus Uses

func (l DefaultLocale) HttpBadStatus() string

func (DefaultLocale) Internal Uses

func (l DefaultLocale) Internal() string

func (DefaultLocale) InvalidPropertyName Uses

func (l DefaultLocale) InvalidPropertyName() string

func (DefaultLocale) InvalidPropertyPattern Uses

func (l DefaultLocale) InvalidPropertyPattern() string

func (DefaultLocale) InvalidType Uses

func (l DefaultLocale) InvalidType() string

func (DefaultLocale) KeyCannotBeGreaterThan Uses

func (l DefaultLocale) KeyCannotBeGreaterThan() string

func (DefaultLocale) KeyItemsMustBeOfType Uses

func (l DefaultLocale) KeyItemsMustBeOfType() string

func (DefaultLocale) KeyItemsMustBeUnique Uses

func (l DefaultLocale) KeyItemsMustBeUnique() string

func (DefaultLocale) MissingDependency Uses

func (l DefaultLocale) MissingDependency() string

func (DefaultLocale) MultipleOf Uses

func (l DefaultLocale) MultipleOf() string

func (DefaultLocale) MustBeGTEZero Uses

func (l DefaultLocale) MustBeGTEZero() string

func (DefaultLocale) MustBeOfA Uses

func (l DefaultLocale) MustBeOfA() string

func (DefaultLocale) MustBeOfAn Uses

func (l DefaultLocale) MustBeOfAn() string

func (DefaultLocale) MustBeOfType Uses

func (l DefaultLocale) MustBeOfType() string

func (DefaultLocale) MustBeValidFormat Uses

func (l DefaultLocale) MustBeValidFormat() string

func (DefaultLocale) MustBeValidRegex Uses

func (l DefaultLocale) MustBeValidRegex() string

func (DefaultLocale) NotAValidType Uses

func (l DefaultLocale) NotAValidType() string

func (DefaultLocale) NumberAllOf Uses

func (l DefaultLocale) NumberAllOf() string

func (DefaultLocale) NumberAnyOf Uses

func (l DefaultLocale) NumberAnyOf() string

func (DefaultLocale) NumberGT Uses

func (l DefaultLocale) NumberGT() string

func (DefaultLocale) NumberGTE Uses

func (l DefaultLocale) NumberGTE() string

func (DefaultLocale) NumberLT Uses

func (l DefaultLocale) NumberLT() string

func (DefaultLocale) NumberLTE Uses

func (l DefaultLocale) NumberLTE() string

func (DefaultLocale) NumberNot Uses

func (l DefaultLocale) NumberNot() string

func (DefaultLocale) NumberOneOf Uses

func (l DefaultLocale) NumberOneOf() string

func (DefaultLocale) ParseError Uses

func (l DefaultLocale) ParseError() string

Parse error

func (DefaultLocale) ReferenceMustBeCanonical Uses

func (l DefaultLocale) ReferenceMustBeCanonical() string

func (DefaultLocale) RegexPattern Uses

func (l DefaultLocale) RegexPattern() string

Schema validators

func (DefaultLocale) Required Uses

func (l DefaultLocale) Required() string

func (DefaultLocale) StringGTE Uses

func (l DefaultLocale) StringGTE() string

func (DefaultLocale) StringLTE Uses

func (l DefaultLocale) StringLTE() string

func (DefaultLocale) Unique Uses

func (l DefaultLocale) Unique() string

type DoesNotMatchFormatError Uses

type DoesNotMatchFormatError struct {
    ResultErrorFields
}

DoesNotMatchFormatError. ErrorDetails: format

type DoesNotMatchPatternError Uses

type DoesNotMatchPatternError struct {
    ResultErrorFields
}

DoesNotMatchPatternError. ErrorDetails: pattern

type Draft Uses

type Draft int
const (
    Draft4 Draft = 4
    Draft6 Draft = 6
    Draft7 Draft = 7
    Hybrid Draft = math.MaxInt32
)

type EmailFormatChecker Uses

type EmailFormatChecker struct{}

EmailFormatter verifies email address formats

func (EmailFormatChecker) IsFormat Uses

func (f EmailFormatChecker) IsFormat(input interface{}) bool

type EnumError Uses

type EnumError struct {
    ResultErrorFields
}

EnumError. ErrorDetails: allowed

type ErrorDetails Uses

type ErrorDetails map[string]interface{}

ErrorDetails is a map of details specific to each error. While the values will vary, every error will contain a "field" value

type FileSystemJSONLoaderFactory Uses

type FileSystemJSONLoaderFactory struct {
    // contains filtered or unexported fields
}

func (FileSystemJSONLoaderFactory) New Uses

func (f FileSystemJSONLoaderFactory) New(source string) JSONLoader

type FormatChecker Uses

type FormatChecker interface {
    IsFormat(input interface{}) bool
}

FormatChecker is the interface all formatters added to FormatCheckerChain must implement

type FormatCheckerChain Uses

type FormatCheckerChain struct {
    // contains filtered or unexported fields
}

FormatCheckerChain holds the formatters

func (*FormatCheckerChain) Add Uses

func (c *FormatCheckerChain) Add(name string, f FormatChecker) *FormatCheckerChain

Add adds a FormatChecker to the FormatCheckerChain The name used will be the value used for the format key in your json schema

func (*FormatCheckerChain) Has Uses

func (c *FormatCheckerChain) Has(name string) bool

Has checks to see if the FormatCheckerChain holds a FormatChecker with the given name

func (*FormatCheckerChain) IsFormat Uses

func (c *FormatCheckerChain) IsFormat(name string, input interface{}) bool

IsFormat will check an input against a FormatChecker with the given name to see if it is the correct format

func (*FormatCheckerChain) Remove Uses

func (c *FormatCheckerChain) Remove(name string) *FormatCheckerChain

Remove deletes a FormatChecker from the FormatCheckerChain (if it exists)

type HostnameFormatChecker Uses

type HostnameFormatChecker struct{}

HostnameFormatChecker validates a hostname is in the correct format

func (HostnameFormatChecker) IsFormat Uses

func (f HostnameFormatChecker) IsFormat(input interface{}) bool

type IPV4FormatChecker Uses

type IPV4FormatChecker struct{}

IPV4FormatChecker verifies IP addresses in the ipv4 format

func (IPV4FormatChecker) IsFormat Uses

func (f IPV4FormatChecker) IsFormat(input interface{}) bool

Credit: https://github.com/asaskevich/govalidator

type IPV6FormatChecker Uses

type IPV6FormatChecker struct{}

IPV6FormatChecker verifies IP addresses in the ipv6 format

func (IPV6FormatChecker) IsFormat Uses

func (f IPV6FormatChecker) IsFormat(input interface{}) bool

Credit: https://github.com/asaskevich/govalidator

type InternalError Uses

type InternalError struct {
    ResultErrorFields
}

InternalError. ErrorDetails: error

type InvalidPropertyNameError Uses

type InvalidPropertyNameError struct {
    ResultErrorFields
}

InvalidPopertyNameError. ErrorDetails: property

type InvalidPropertyPatternError Uses

type InvalidPropertyPatternError struct {
    ResultErrorFields
}

InvalidPropertyPatternError. ErrorDetails: property, pattern

type InvalidTypeError Uses

type InvalidTypeError struct {
    ResultErrorFields
}

InvalidTypeError. ErrorDetails: expected, given

type ItemsMustBeUniqueError Uses

type ItemsMustBeUniqueError struct {
    ResultErrorFields
}

ItemsMustBeUniqueError. ErrorDetails: type, i, j

type JSONLoader Uses

type JSONLoader interface {
    JsonSource() interface{}
    LoadJSON() (interface{}, error)
    JsonReference() (gojsonreference.JsonReference, error)
    LoaderFactory() JSONLoaderFactory
}

func NewBytesLoader Uses

func NewBytesLoader(source []byte) JSONLoader

func NewGoLoader Uses

func NewGoLoader(source interface{}) JSONLoader

func NewReaderLoader Uses

func NewReaderLoader(source io.Reader) (JSONLoader, io.Reader)

func NewReferenceLoader Uses

func NewReferenceLoader(source string) JSONLoader

NewReferenceLoader returns a JSON reference loader using the given source and the local OS file system.

func NewReferenceLoaderFileSystem Uses

func NewReferenceLoaderFileSystem(source string, fs http.FileSystem) JSONLoader

NewReferenceLoaderFileSystem returns a JSON reference loader using the given source and file system.

func NewStringLoader Uses

func NewStringLoader(source string) JSONLoader

func NewWriterLoader Uses

func NewWriterLoader(source io.Writer) (JSONLoader, io.Writer)

type JSONLoaderFactory Uses

type JSONLoaderFactory interface {
    New(source string) JSONLoader
}

type JSONPointerFormatChecker Uses

type JSONPointerFormatChecker struct{}

JSONPointerFormatChecker validates a JSON Pointer per RFC6901

func (JSONPointerFormatChecker) IsFormat Uses

func (f JSONPointerFormatChecker) IsFormat(input interface{}) bool

type JsonContext Uses

type JsonContext struct {
    // contains filtered or unexported fields
}

JsonContext implements a persistent linked-list of strings

func NewJsonContext Uses

func NewJsonContext(head string, tail *JsonContext) *JsonContext

func (*JsonContext) String Uses

func (c *JsonContext) String(del ...string) string

String displays the context in reverse. This plays well with the data structure's persistent nature with Cons and a json document's tree structure.

type MissingDependencyError Uses

type MissingDependencyError struct {
    ResultErrorFields
}

MissingDependencyError. ErrorDetails: dependency

type MultipleOfError Uses

type MultipleOfError struct {
    ResultErrorFields
}

MultipleOfError. ErrorDetails: multiple

type NumberAllOfError Uses

type NumberAllOfError struct {
    ResultErrorFields
}

NumberAllOfError. ErrorDetails: -

type NumberAnyOfError Uses

type NumberAnyOfError struct {
    ResultErrorFields
}

NumberAnyOfError. ErrorDetails: -

type NumberGTEError Uses

type NumberGTEError struct {
    ResultErrorFields
}

NumberGTEError. ErrorDetails: min

type NumberGTError Uses

type NumberGTError struct {
    ResultErrorFields
}

NumberGTError. ErrorDetails: min

type NumberLTEError Uses

type NumberLTEError struct {
    ResultErrorFields
}

NumberLTEError. ErrorDetails: max

type NumberLTError Uses

type NumberLTError struct {
    ResultErrorFields
}

NumberLTError. ErrorDetails: max

type NumberNotError Uses

type NumberNotError struct {
    ResultErrorFields
}

NumberNotError. ErrorDetails: -

type NumberOneOfError Uses

type NumberOneOfError struct {
    ResultErrorFields
}

NumberOneOfError. ErrorDetails: -

type RegexFormatChecker Uses

type RegexFormatChecker struct{}

RegexFormatChecker validates a regex is in the correct format

func (RegexFormatChecker) IsFormat Uses

func (f RegexFormatChecker) IsFormat(input interface{}) bool

IsFormat implements FormatChecker interface.

type RelativeJSONPointerFormatChecker Uses

type RelativeJSONPointerFormatChecker struct{}

RelativeJSONPointerFormatChecker validates a relative JSON Pointer is in the correct format

func (RelativeJSONPointerFormatChecker) IsFormat Uses

func (f RelativeJSONPointerFormatChecker) IsFormat(input interface{}) bool

type RequiredError Uses

type RequiredError struct {
    ResultErrorFields
}

RequiredError. ErrorDetails: property string

type Result Uses

type Result struct {
    // contains filtered or unexported fields
}

func Validate Uses

func Validate(ls JSONLoader, ld JSONLoader) (*Result, error)

func (*Result) AddError Uses

func (v *Result) AddError(err ResultError, details ErrorDetails)

Add a fully filled error to the error set SetDescription() will be called with the result of the parsed err.DescriptionFormat()

func (*Result) Errors Uses

func (v *Result) Errors() []ResultError

func (*Result) Valid Uses

func (v *Result) Valid() bool

type ResultError Uses

type ResultError interface {
    Field() string
    SetType(string)
    Type() string
    SetContext(*JsonContext)
    Context() *JsonContext
    SetDescription(string)
    Description() string
    SetDescriptionFormat(string)
    DescriptionFormat() string
    SetValue(interface{})
    Value() interface{}
    SetDetails(ErrorDetails)
    Details() ErrorDetails
    String() string
}

ResultError is the interface that library errors must implement

type ResultErrorFields Uses

type ResultErrorFields struct {
    // contains filtered or unexported fields
}

ResultErrorFields holds the fields for each ResultError implementation. ResultErrorFields implements the ResultError interface, so custom errors can be defined by just embedding this type

func (*ResultErrorFields) Context Uses

func (v *ResultErrorFields) Context() *JsonContext

func (*ResultErrorFields) Description Uses

func (v *ResultErrorFields) Description() string

func (*ResultErrorFields) DescriptionFormat Uses

func (v *ResultErrorFields) DescriptionFormat() string

func (*ResultErrorFields) Details Uses

func (v *ResultErrorFields) Details() ErrorDetails

func (*ResultErrorFields) Field Uses

func (v *ResultErrorFields) Field() string

Field outputs the field name without the root context i.e. firstName or person.firstName instead of (root).firstName or (root).person.firstName

func (*ResultErrorFields) SetContext Uses

func (v *ResultErrorFields) SetContext(context *JsonContext)

func (*ResultErrorFields) SetDescription Uses

func (v *ResultErrorFields) SetDescription(description string)

func (*ResultErrorFields) SetDescriptionFormat Uses

func (v *ResultErrorFields) SetDescriptionFormat(descriptionFormat string)

func (*ResultErrorFields) SetDetails Uses

func (v *ResultErrorFields) SetDetails(details ErrorDetails)

func (*ResultErrorFields) SetType Uses

func (v *ResultErrorFields) SetType(errorType string)

func (*ResultErrorFields) SetValue Uses

func (v *ResultErrorFields) SetValue(value interface{})

func (ResultErrorFields) String Uses

func (v ResultErrorFields) String() string

func (*ResultErrorFields) Type Uses

func (v *ResultErrorFields) Type() string

func (*ResultErrorFields) Value Uses

func (v *ResultErrorFields) Value() interface{}

type Schema Uses

type Schema struct {
    // contains filtered or unexported fields
}

func NewSchema Uses

func NewSchema(l JSONLoader) (*Schema, error)

func (*Schema) SetRootSchemaName Uses

func (d *Schema) SetRootSchemaName(name string)

func (*Schema) Validate Uses

func (v *Schema) Validate(l JSONLoader) (*Result, error)

type SchemaLoader Uses

type SchemaLoader struct {
    AutoDetect bool
    Validate   bool
    Draft      Draft
    // contains filtered or unexported fields
}

func NewSchemaLoader Uses

func NewSchemaLoader() *SchemaLoader

func (*SchemaLoader) AddSchema Uses

func (sl *SchemaLoader) AddSchema(url string, loader JSONLoader) error

AddSchema adds a schema under the provided URL to the schema cache

func (*SchemaLoader) AddSchemas Uses

func (sl *SchemaLoader) AddSchemas(loaders ...JSONLoader) error

AddSchemas adds an arbritrary amount of schemas to the schema cache. As this function does not require an explicit URL, every schema should contain an $id, so that it can be referenced by the main schema

func (*SchemaLoader) Compile Uses

func (sl *SchemaLoader) Compile(rootSchema JSONLoader) (*Schema, error)

type StringLengthGTEError Uses

type StringLengthGTEError struct {
    ResultErrorFields
}

StringLengthGTEError. ErrorDetails: min

type StringLengthLTEError Uses

type StringLengthLTEError struct {
    ResultErrorFields
}

StringLengthLTEError. ErrorDetails: max

type TimeFormatChecker Uses

type TimeFormatChecker struct{}

func (TimeFormatChecker) IsFormat Uses

func (f TimeFormatChecker) IsFormat(input interface{}) bool

type URIFormatChecker Uses

type URIFormatChecker struct{}

URIFormatChecker validates a URI with a valid Scheme per RFC3986

func (URIFormatChecker) IsFormat Uses

func (f URIFormatChecker) IsFormat(input interface{}) bool

type URIReferenceFormatChecker Uses

type URIReferenceFormatChecker struct{}

URIReferenceFormatChecker validates a URI or relative-reference per RFC3986

func (URIReferenceFormatChecker) IsFormat Uses

func (f URIReferenceFormatChecker) IsFormat(input interface{}) bool

type URITemplateFormatChecker Uses

type URITemplateFormatChecker struct{}

URITemplateFormatChecker validates a URI template per RFC6570

func (URITemplateFormatChecker) IsFormat Uses

func (f URITemplateFormatChecker) IsFormat(input interface{}) bool

type UUIDFormatChecker Uses

type UUIDFormatChecker struct{}

UUIDFormatChecker validates a UUID is in the correct format

func (UUIDFormatChecker) IsFormat Uses

func (f UUIDFormatChecker) IsFormat(input interface{}) bool

Package gojsonschema imports 25 packages (graph) and is imported by 197 packages. Updated 2019-01-08. Refresh now. Tools for package owners.