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

Embedded structs are not being serialized. #21

Open

Description

@xomaczar
type Foo struct {
     Name      string    `jsonapi:"attr,name"`
     CreatedOn time.Time `jsonapi:"attr,createdOn"`
}

type Bar struct {
     Foo    
     ID   string `jsonapi:"primary,bars"`
     Last string `jsonapi:"attr,last"`
}

Marshaling Bar struct, ignores embedded fields from Foo (i.e. name, createdOn)

Activity

  1. shwoodard commented on Jan 12, 2016

    @shwoodard
    Contributor

    I don't believe the stdlib json parser even supports this.

  2. xomaczar commented on Jan 12, 2016

    @xomaczar
    Author

    @shwoodard it does - json.Marshal(Bar{}) would result in json with Name, CreatedOn, ID, Last included.

  3. shwoodard commented on Jan 28, 2016

    @shwoodard
    Contributor

    @xomaczar Wanna take a crack at this and send a PR?

  4. added 3 commits that reference this issue on Apr 10, 2016
  5. brandonbloom commented on May 4, 2016

    @brandonbloom
    Contributor

    I'd like this too. Looks like you've started working on it. Anything we can do to help?

  6. added a commit that references this issue on Jul 18, 2016
  7. cfatt10 commented on Dec 6, 2016

    @cfatt10

    I am running into this issue in my code. Has any more progress been made, or a workaround discovered?

  8. xomaczar commented on Dec 6, 2016

    @xomaczar
    Author
  9. svperfecta commented on Jan 10, 2017

    @svperfecta

    I think we should close this one?

  10. gonzalo-bulnes commented on Feb 22, 2017

    @gonzalo-bulnes

    Hello! I can confirm that #78 works as expected.

  11. pioz commented on Oct 11, 2019

    @pioz

    Any update for this issue? When do you think that the branch feature/embeded-structs will be merged to master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions