Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Flatten non embedded fields #715

@Daniel63656

Description

@Daniel63656

I need a way to treat sub-structs as if they are anonymously embedded when marshalling/unmarshalling to json. Is this possible with jsoniter extensions? Couldn't find any documentation on extensions.

Please help

type Entity struct {
    Metadata *Metadata <-- Treat this as if it were just *Metadata during marshal/unmarshal
    UpdatedAt string `json:"/updatedAt"`
    Id        string `json:"/id"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions