Where do you set a struct's field value to its JSON Schema defined default? #461
Unanswered
lazharichir
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say I have a struct defined as follows:
I want to use the
huma
JSON Schema parsing to take an incomingmap[string]any
and convert it to an instance ofWordCounterV1Config
with the relevant default values as per the struct tags (if they aren't defined).This is used outside the API declaration and more for internal/domain stuff.
I'm trying to see how to do it via
huma
ashuma.Validate()
doesn't mutate the input to add default values.Beta Was this translation helpful? Give feedback.
All reactions