Skip to content

feature: Have a way to collect untyped remaining fields. #624

@burdiyan

Description

@burdiyan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions