-
Notifications
You must be signed in to change notification settings - Fork 13
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
Handling Defaults #136
Comments
I like this idea |
I'm working on PR for this. |
This was referenced Feb 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current implementation ignores default values. I would like to suggest the following changes:
UnmarshalJSON
andUnmarshalYAML
methods to set default values before deserialization happens. This is required to properly handle deserialization of slices and maps. The limitations is other Unmarshallers would not properly handle default values, but with JSON and YAML it should cover most of the use cases.User code would need to use the factory function:
The text was updated successfully, but these errors were encountered: