Documentation
¶
Index ¶
- Variables
- func ApplyDefaults(defaults *DefaultResult, v reflect.Value)
- func ConvertType(fieldName string, t reflect.Type, v any) any
- func DefaultSchemaNamer(t reflect.Type, hint string) string
- func FromField(registry core.Registry, f reflect.StructField, hint string) *core.Schema
- func FromType(r core.Registry, t reflect.Type) *core.Schema
- func JsonTagValue(r core.Registry, fieldName string, s *core.Schema, value string) any
- func Validate(r core.Registry, s *core.Schema, path *core.PathBuffer, mode core.ValidateMode, ...)
- type ConfigProvider
- type DefaultResult
- type DefaultResultPath
- type MapRegistry
- func (r *MapRegistry) Map() map[string]*core.Schema
- func (r *MapRegistry) MarshalJSON() ([]byte, error)
- func (r *MapRegistry) MarshalYAML() (any, error)
- func (r *MapRegistry) RegisterTypeAlias(t reflect.Type, alias reflect.Type)
- func (r *MapRegistry) RegistryConfig() RegistryConfig
- func (r *MapRegistry) Schema(t reflect.Type, allowRef bool, hint string) *core.Schema
- func (r *MapRegistry) SchemaFromRef(ref string) *core.Schema
- func (r *MapRegistry) TypeFromRef(ref string) reflect.Type
- type ModelValidator
- type RegistryConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultArrayNullable = true
View Source
var ValidateStrictCasing = false
Functions ¶
func ApplyDefaults ¶
func ApplyDefaults(defaults *DefaultResult, v reflect.Value)
func JsonTagValue ¶
func Validate ¶
func Validate(r core.Registry, s *core.Schema, path *core.PathBuffer, mode core.ValidateMode, v any, res *core.ValidateResult)
Types ¶
type ConfigProvider ¶
type ConfigProvider interface {
RegistryConfig() RegistryConfig
}
type DefaultResult ¶
type DefaultResult struct {
Paths []DefaultResultPath
}
func FindDefaults ¶
func FindDefaults(registry core.Registry, t reflect.Type) *DefaultResult
func (*DefaultResult) EveryPB ¶
func (r *DefaultResult) EveryPB(pb *core.PathBuffer, v reflect.Value, f func(reflect.Value, any))
type DefaultResultPath ¶
type MapRegistry ¶
type MapRegistry struct {
// contains filtered or unexported fields
}
func NewMapRegistry ¶
func NewMapRegistry(namer func(t reflect.Type, hint string) string) *MapRegistry
func NewMapRegistryWithConfig ¶
func NewMapRegistryWithConfig(namer func(t reflect.Type, hint string) string, config RegistryConfig) *MapRegistry
func (*MapRegistry) MarshalJSON ¶
func (r *MapRegistry) MarshalJSON() ([]byte, error)
func (*MapRegistry) MarshalYAML ¶
func (r *MapRegistry) MarshalYAML() (any, error)
func (*MapRegistry) RegisterTypeAlias ¶
func (r *MapRegistry) RegisterTypeAlias(t reflect.Type, alias reflect.Type)
func (*MapRegistry) RegistryConfig ¶
func (r *MapRegistry) RegistryConfig() RegistryConfig
func (*MapRegistry) SchemaFromRef ¶
func (r *MapRegistry) SchemaFromRef(ref string) *core.Schema
func (*MapRegistry) TypeFromRef ¶
func (r *MapRegistry) TypeFromRef(ref string) reflect.Type
type ModelValidator ¶
type ModelValidator struct {
// contains filtered or unexported fields
}
func NewModelValidator ¶
func NewModelValidator() *ModelValidator
type RegistryConfig ¶
Click to show internal directories.
Click to hide internal directories.