Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root array feature #17

Open
mfolkeseth opened this issue Aug 1, 2024 · 1 comment
Open

Root array feature #17

mfolkeseth opened this issue Aug 1, 2024 · 1 comment

Comments

@mfolkeseth
Copy link

Hello,

Thanks for making such a neat tool.

I was wondering if there is any possibility of adding a root array feature? Let med demonstrate.

Proposed signature and usage

func StructToZodArraySchema(input interface{}, name)

users := StructToZodArraySchema(User{}, 'Users')

(note plural)

export const UsersSchema = z.array(UserSchema)
@Southclaws
Copy link
Owner

Hey, thanks, glad it's useful!

Top level arrays make sense, though I don't actively use this library any more so I just review and accept PRs for features currently. It should be fairly easy to implement though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants