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

Opinions Wanted: Struct Generation #49

Open
Oudwins opened this issue Nov 8, 2024 · 0 comments
Open

Opinions Wanted: Struct Generation #49

Oudwins opened this issue Nov 8, 2024 · 0 comments

Comments

@Oudwins
Copy link
Owner

Oudwins commented Nov 8, 2024

One of the next features I would like to work on is a CLI to generate structs based on your ZogSchemas. This is a good first step for other generators based on the ZogSchemas such as but not limited to:

  • typescript types
  • Zod schemas
  • openapi specs
  • ...

With that in mind I would like to pool you all on a few things:

  • Any other output you would like? (a part from the ones mentioned above)
  • Once you run the CLI should the generation be opt in or opt out? i.e should running the CLI automatically generate all corresponding structs unless your ZogSchema has some magic comment above it or only generate those that have that magic comment?
  • Ideas on the generated names for the structs. I think the best solution is to use standard naming convention for default generated names but allow the user to specify a struct name with a magic comment. For example, if no magic comment is set userSchema would generate a type User struct
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

1 participant