Replies: 1 comment 1 reply
-
You could try building a code generator (look into Golang code generation, it's fairly straightforward) that outputs structs with tags from some input format you create. There's not really a programmatic way to create structs at runtime that you could write code against to do something with the values you get. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I've been using Go structs to define inputs and outputs and it has been working great! I was now thinking of a more customizable approach.
Is there any way to load in query fields, from a file for example, and generate input/output models from it?
Ideally just by adding extra query fields to the file (specifying field name, tag, type, validation, doc), Huma would generate the complete schema for all the fields.
This probably requires the use of maps instead of structs, but from what I understood Huma only expects structs, unless I missed something from the documentation?
Beta Was this translation helpful? Give feedback.
All reactions