Skip to content
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

Unmarshaling does not correctly parse the "included" part #346

Open
fakegermano opened this issue May 20, 2022 · 0 comments
Open

Unmarshaling does not correctly parse the "included" part #346

fakegermano opened this issue May 20, 2022 · 0 comments
Labels

Comments

@fakegermano
Copy link

when unmarshaling data that was marshaled with the "included" portion (using GetReferencedStructs interface) the jsonapi unmarshaling does not add the included.

I'd suggest some interface like SetToOneReferencedStructs(name string, referenced interface{}) and SetToManyReferencedStructs(name string, referenced []interface{}) as we do with the IDs to allow the user to decide for themselves if they want or not to unmarshal included structs.

Another option is to add more struct tags to identify the relations (like https://github.com/google/jsonapi does) and do at least a part of the unmarshaling automatically

@sharpner sharpner added the bug label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants