-
Notifications
You must be signed in to change notification settings - Fork 215
Nested structs not being Unmarshaled #49
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
Comments
Your payload is not valid JSON API; even if it was (see below) I don't believe the nested struct is supported. {
"data": {
"type": "info",
"attributes": {
"phone": "555-555-5555",
"homeaddress": {
"city": "brooklyn",
"state": "NY"
}
}
}
} If you want, please submit a PR adding support for this feature. Please ensure the implementation follow the JSON API spec's Attributes guidelines:
|
Sorry about that - my actual json was valid jsonAPI, I had just extracted the relevant part of the In any case, I seem to have gotten the functionality I need by declaring the type of HomeAddress to be a I'll leave the feature request open because I still think it would be valuable to have nested struct handling. Perhaps someone else reading this might be able to pick it up and work on it. |
+1 for this feature please |
Dup of #21 |
#21 is more about embedded anonymous structs. This issue is about structs as a field in a struct. |
Given a struct that contains another struct:
When calling
UnmarshalPayload
with this json:I get an error
data is not a jsonapi representation of AdditionalInfo
. Are nested structs not supported?The text was updated successfully, but these errors were encountered: