Documentation
¶
Index ¶
- func Generate(mapper goToZodMapper, outputFileName string)
- func GenerateString(mapper goToZodMapper, outputFileName string) string
- func NewMapper(options ...Option) goToZodMapper
- func NewMapperWithSupport(options ...Option) goToZodMapper
- func SupportingDeclarations(mapper goToZodMapper) ts.Source
- func WithDiscriminatedUnion(t goinsp.GenType, discriminatorProperty string, types ...goinsp.Type) func(*config)
- type JSONDiscriminatedUnion
- type JSONDiscriminator
- type Option
- func WithCommentsLoader(loader comments.Loader) Option
- func WithDiscriminator(t goinsp.GenType, property, value string) Option
- func WithName(t goinsp.GenType, name string) Option
- func WithResolvingSchema(t goinsp.GenType, ...) Option
- func WithResolvingTransform(t goinsp.GenType, ...) Option
- func WithSchema(t goinsp.GenType, schema zod.ZodType) Option
- func WithTemplate(t goinsp.GenType, template string) Option
- func WithTransform(t goinsp.GenType, expr ts.Source) Option
- func WithUndiscriminatedUnion(t goinsp.GenType, types ...goinsp.Type) Option
- func WithUnnamedType(t goinsp.GenType) Option
- type Resolver
- type TypeOptions
- func (o TypeOptions) Named(name string) TypeOptions
- func (o TypeOptions) ResolvingSchema(schema func(resolver Resolver[goinsp.Type, zod.ZodType]) zod.ZodType) TypeOptions
- func (o TypeOptions) ResolvingTransform(f func(resolver Resolver[goinsp.Type, zod.ZodType]) ts.Source) TypeOptions
- func (o TypeOptions) Schema(schema zod.ZodType) TypeOptions
- func (o TypeOptions) Template(template string) TypeOptions
- func (o TypeOptions) Transform(f ts.Source) TypeOptions
- func (o TypeOptions) Transformf(format string, as ...any) TypeOptions
- func (o TypeOptions) UndiscriminatedUnionOf(disjuncts ...goinsp.Type) Option
- func (o TypeOptions) Unnamed() TypeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateString ¶
func NewMapperWithSupport ¶
func NewMapperWithSupport(options ...Option) goToZodMapper
func SupportingDeclarations ¶
Types ¶
type JSONDiscriminatedUnion ¶
type JSONDiscriminator ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithCommentsLoader ¶
func WithResolvingSchema ¶
func WithResolvingTransform ¶
func WithUnnamedType ¶
type TypeOptions ¶
type TypeOptions struct {
// contains filtered or unexported fields
}
func ForType ¶
func ForType(t goinsp.GenType) TypeOptions
func When ¶
func When[T any]() TypeOptions
func WhenGeneric ¶
func WhenGeneric[T any]() TypeOptions
func (TypeOptions) Named ¶
func (o TypeOptions) Named(name string) TypeOptions
func (TypeOptions) ResolvingSchema ¶
func (o TypeOptions) ResolvingSchema(schema func(resolver Resolver[goinsp.Type, zod.ZodType]) zod.ZodType) TypeOptions
func (TypeOptions) ResolvingTransform ¶
func (o TypeOptions) ResolvingTransform(f func(resolver Resolver[goinsp.Type, zod.ZodType]) ts.Source) TypeOptions
func (TypeOptions) Schema ¶
func (o TypeOptions) Schema(schema zod.ZodType) TypeOptions
func (TypeOptions) Template ¶
func (o TypeOptions) Template(template string) TypeOptions
func (TypeOptions) Transform ¶
func (o TypeOptions) Transform(f ts.Source) TypeOptions
func (TypeOptions) Transformf ¶
func (o TypeOptions) Transformf(format string, as ...any) TypeOptions
func (TypeOptions) UndiscriminatedUnionOf ¶
func (o TypeOptions) UndiscriminatedUnionOf(disjuncts ...goinsp.Type) Option
func (TypeOptions) Unnamed ¶
func (o TypeOptions) Unnamed() TypeOptions
Click to show internal directories.
Click to hide internal directories.