You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Complex data structures involving JSON objects and arrays are allowed as attribute values. However, any object that constitutes or is contained in an attribute MUST NOT contain a relationships or links member, as those members are reserved by this specification for future use.
Sorry about that - my actual json was valid jsonAPI, I had just extracted the relevant part of the attributes key.
In any case, I seem to have gotten the functionality I need by declaring the type of HomeAddress to be a map[string]interface{} and handling any conversions between map and struct elsewhere. It's obviously not ideal but it's all I have right now.
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.
Activity
aren55555 commentedon Aug 31, 2016
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:
iderdik commentedon Sep 1, 2016
Sorry about that - my actual json was valid jsonAPI, I had just extracted the relevant part of the
attributeskey.In any case, I seem to have gotten the functionality I need by declaring the type of HomeAddress to be a
map[string]interface{}and handling any conversions betweenmapandstructelsewhere. It's obviously not ideal but it's all I have right now.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.
bensullivan commentedon Sep 17, 2016
+1 for this feature please
shwoodard commentedon Sep 22, 2016
Dup of #21
iderdik commentedon Sep 22, 2016
#21 is more about embedded anonymous structs. This issue is about structs as a field in a struct.
msabramo commentedon Jan 18, 2018
See #99 and mrowdy#3, which fixes pointers to struct fields.