Documentation
¶
Overview ¶
Code generated by genx:code@v0.4.2 DO NOT EDIT.
Index ¶
- func DefaultRuleByType(t reflect.Type) string
- func IsValidationError(err error) bool
- func PrefixPointer(err error, prefix jsontext.Pointer) error
- func Register(p Provider)
- func UnmarshalDecode(d *jsontext.Decoder, v any, o ...json.Options) error
- func WrapPointer(err error, p jsontext.Pointer) error
- type Error
- type Option
- type PointerError
- type PostValidator
- type Provider
- type TagValidator
- type UnmarshalDecoder
- func Any(rv reflect.Value, va Validator) UnmarshalDecoder
- func Array(rv reflect.Value, va Validator) UnmarshalDecoder
- func Basic(rv reflect.Value, va Validator) UnmarshalDecoder
- func Map(rv reflect.Value, va Validator) UnmarshalDecoder
- func Pointer(rv reflect.Value, va Validator) UnmarshalDecoder
- func Struct(rv reflect.Value, va Validator) UnmarshalDecoder
- func Text(rv reflect.Value, va Validator) UnmarshalDecoder
- func Value(rv reflect.Value, va Validator) UnmarshalDecoder
- type Validator
- type WithDefaults
- type WithElemRule
- type WithKeyRule
- type WithOptional
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRuleByType ¶
func IsValidationError ¶
func PrefixPointer ¶
PrefixPointer prepends prefix to the pointers in err. It is used when err comes from a nested document whose root is located by prefix in the outer document, eg: a request body is located by `/body` in the request.
Types ¶
type Error ¶
type Error int8
Error validation error +genx:code
const ( ERROR_UNDEFINED Error = iota ERROR__STRING_LENGTH_MODE // invalid string length mode, expect 'byte' or 'rune' ERROR__NOT_MATCH_REGEXP // invalid string not match regexp ERROR__SLICE_PARAM // invalid string parameter ERROR__MAP_PARAM // invalid map parameter ERROR__INPUT_TYPE // invalid input: invalid type ERROR__INPUT_VALUE // invalid input: invalid value ERROR__MISSING_REQUIRED // invalid input: missing required ERROR__UNREGISTERED_RULE // unregistered rule ERROR__DEC_INVALID_INPUT // decoder: invalid input, expecting a pointer value )
func (Error) CodeIdentifier ¶
CodeIdentifier returns the unique identifier of the code
type PointerError ¶
type PointerError struct {
// contains filtered or unexported fields
}
PointerError locates err by a JSON Pointer (RFC 6901) in the request document.
func (*PointerError) Error ¶
func (e *PointerError) Error() string
func (*PointerError) Pointer ¶
func (e *PointerError) Pointer() jsontext.Pointer
func (*PointerError) Unwrap ¶
func (e *PointerError) Unwrap() error
type PostValidator ¶
type TagValidator ¶
type TagValidator interface {
ValidationTag() string
}
type UnmarshalDecoder ¶
type WithDefaults ¶
type WithDefaults interface {
Defaults() []byte
}
type WithElemRule ¶
type WithKeyRule ¶
type WithOptional ¶
type WithOptional interface {
Optional() bool
}