How would you like Schema to struct generation to look like? #67
Replies: 2 comments
-
No idea yet
Generate those that have the magic comment would be better. It would be easier and cleaner for embedding with existing codegen (e.g. rpc, db code generation)
I have no opinion on |
Beta Was this translation helpful? Give feedback.
-
Some form of JSON. I was thinking how I could make validation from client to server consume less requests (and reduce waiting) so I thought in a HTMX/DataStar (or AlpineJS) it might be faster to have a little JSON object that can be embedded in a response, and a little library that can infer the schema from that and use it. That said - this is basically "shower thoughts" level of idea... It makes more sense to use Zod, to be honest, but it would be interesting.
Go already has compiler directives like
Your idea is good! Could also opt for a no-op function ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
With that in mind I would like to pool you all on a few things:
userSchemawould generate atype User structBeta Was this translation helpful? Give feedback.
All reactions