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:"item"` MinItems *int `json:"minItems,omitempty"` }
func NewArray ¶
func NewArray(itemSchema JsonSchema, minItems *int) Array
type Boolean ¶
type Boolean struct {
Type string `json:"type"`
}
func NewBoolean ¶
func NewBoolean() Boolean
type Integer ¶
type Integer struct {
Type string `json:"type"`
}
func NewInteger ¶
func NewInteger() Integer
type JsonSchema ¶
type JsonSchema interface {
Kind() Kind
}
func FromTypeRef ¶
func FromTypeRef(operation, definition *ast.Document, typeRef int) JsonSchema
func FromTypeRefWithOverrides ¶ added in v1.43.2
func FromTypeRefWithOverrides(operation, definition *ast.Document, typeRef int, overrides map[string]JsonSchema) 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"` }
func NewObjectAny ¶ added in v1.38.2
func NewObjectAny() Object
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.