You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Sometimes it's useful to have partially defined types for the data, but still being able to collect the remaining fields in more of a dynamic way as a map[string]any or map[any]any.
Describe the solution you'd like
Introduce a new struct field tag, similar to the remain tag in the popular mapstructure library. The type of a field with such a tag should be a map, into which those values that are not defined on the concrete type could be collected for later access.
Describe alternatives you've considered
Having a named type for a map, like type UnknownFields map[string]any which when embedded into a struct would collect the remainder fields.
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue! This sounds useful and I will need to look into it.
burdiyan
changed the title
feature: Have a way to collect untypes remaining fields.
feature: Have a way to collect untyped remaining fields.
Mar 3, 2025
Is your feature request related to a problem? Please describe.
Sometimes it's useful to have partially defined types for the data, but still being able to collect the remaining fields in more of a dynamic way as a
map[string]any
ormap[any]any
.Describe the solution you'd like
Introduce a new struct field tag, similar to the
remain
tag in the popular mapstructure library. The type of a field with such a tag should be a map, into which those values that are not defined on the concrete type could be collected for later access.Describe alternatives you've considered
Having a named type for a map, like
type UnknownFields map[string]any
which when embedded into a struct would collect the remainder fields.The text was updated successfully, but these errors were encountered: