Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TopLevelType ¶
func TopLevelType(schema string) (jsonparser.ValueType, error)
Types ¶
type Array ¶
type Array struct { Type []string `json:"type"` Items JsonSchema `json:"items"` MinItems *int `json:"minItems,omitempty"` Defs map[string]JsonSchema `json:"$defs,omitempty"` }
func NewArray ¶
func NewArray(itemSchema JsonSchema, nonNull bool) Array
type JsonSchema ¶
type JsonSchema interface {
Kind() Kind
}
func FromTypeRef ¶
func FromTypeRef(operation, definition *ast.Document, typeRef int, opts ...Option) JsonSchema
type Object ¶
type Object struct { Type []string `json:"type"` Properties map[string]JsonSchema `json:"properties,omitempty"` Required []string `json:"required,omitempty"` AdditionalProperties bool `json:"additionalProperties"` Defs map[string]JsonSchema `json:"$defs,omitempty"` }
func NewObjectAny ¶
type Option ¶
type Option func(opts *options)
func WithOverrides ¶
func WithOverrides(overrides map[string]JsonSchema) Option
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func MustNewValidatorFromSchema ¶
func MustNewValidatorFromSchema(schema JsonSchema) *Validator
func NewValidatorFromSchema ¶
func NewValidatorFromSchema(schema JsonSchema) (*Validator, error)
func NewValidatorFromString ¶
Click to show internal directories.
Click to hide internal directories.