Versions in this module Expand all Collapse all v0 v0.0.2 Feb 17, 2026 Changes in this version + func NewSchemaRefForValue(value any) (*openapi3.SchemaRef, error) + type DateRule struct + func (r *DateRule) Describe(_ string, _ *openapi3.Schema, ref *openapi3.SchemaRef) error + func (r *DateRule) Max(t time.Time) *DateRule + func (r *DateRule) Min(t time.Time) *DateRule + type WhenRule struct + func (r *WhenRule) Describe(name string, _ *openapi3.Schema, ref *openapi3.SchemaRef) error + func (r *WhenRule) Else(rules ...Rule) *WhenRule v0.0.1 Feb 14, 2026 Changes in this version + var Empty = absentRule + var Nil = absentRule + var NotNil = notNilRule + var Required = requiredRule + func AddPath(path, method string, s *openapi3.T, op *openapi3.Operation) + func Date(layout string) *dateRule + func DecodeAndValidate(r io.Reader, dst any) error + func DecodeAndValidateContext(ctx context.Context, r io.Reader, dst any) error + func DocBase(serviceName, description, version string) *openapi3.T + func MissingRules(structPtr any, exclude ...string) []string + func NewRequest(vs ...any) (*openapi3.RequestBodyRef, error) + func NewRequestMust(vs ...any) *openapi3.RequestBodyRef + func NewResponse(vs map[string]Response) (*openapi3.Responses, error) + func NewResponseMust(vs map[string]Response) *openapi3.Responses + func StructMulti(v any, fns ...func(any)) + func StructStringFunc(v any, f func(string) string) + func StructToLower(v any) + func StructTrimSpace(v any) + func SwaggerHandler(prefix string, s *openapi3.T) (http.Handler, error) + func SwaggerHandlerMust(prefix string, s *openapi3.T) http.Handler + func UnmarshalAndValidate(b []byte, dst any) error + func UnmarshalAndValidateCtx(ctx context.Context, b []byte, dst any) error + func Validate(value any) error + func ValidateCtx(ctx context.Context, value any) error + func ValidateStruct(structPtr any, fields []*FieldRules) error + func When(condition bool, desc string, rules ...Rule) *whenRule + type ContextNormalizer interface + Normalize func(context.Context) + type ContextRuler interface + Rules func(context.Context) []*FieldRules + type FieldRules struct + func Field[T any](fieldPtr *T, rules ...Rule) *FieldRules + type Normalizer interface + Normalize func() + type Response struct + Desc string + V []any + type Rule interface + Describe func(name string, schema *openapi3.Schema, ref *openapi3.SchemaRef) error + Validate func(value any) error + func By(f RuleFunc, desc string) Rule + func Custom(f func(any) error, desc string) Rule + func Default(a any) Rule + func Deprecate() Rule + func Describe(desc string) Rule + func Each(rules ...Rule) Rule + func Example(ex any) Rule + func HasAlphabetic() Rule + func In(values ...any) Rule + func KeyIn(values ...string) Rule + func Length(lo, hi int) Rule + func Max(threshold any) Rule + func Min(threshold any) Rule + func NewStringRule(validator func(string) bool, desc string) Rule + func NewStringRuleDecimalMax(i uint) Rule + func NewStringRuleWithError(validator func(string) bool, err validation.Error, desc string) Rule + func NonCreditCardNumber() Rule + func Skip(desc string) Rule + func Unique(f func(a int) any, desc string) Rule + type RuleFunc func(value any) error + type Ruler interface + Rules func() []*FieldRules + type ValidationErrors = validation.Errors + type ValueRuler interface + ValueRules func() []Rule