Closed mglaman closed 5 years ago
@mglaman, I'm curious why your example doesn't fully implement the JSON API document structure but only takes influence from it. For example, your example puts the id
outside the data
key and it doesn't have attribute
or relationships
keys.
@mglaman, I'm curious why your example doesn't fully implement the JSON API document structure but only takes influence from it.
Because I quick wrote this :) And I don't want to rewrite the internal normalizers JSON API module does not expose.
Also, I don't think an order should define relationships. Order items should be represented as if embedded entities.
Because I quick wrote this :)
That's what I figured but wanted to check. I realize now that I probably sounded harsh, sorry!
Also, I don't think an order should define relationships. Order items should be represented as if embedded entities.
Let's discuss this at DrupalCon, there are some really nice properties that come out of it that I bet you will appreciate :)
@gabesullice I didn't take it harsh. I also don't know the JSON API spec schema very well (I know there's data.attributes and some things :D that's about it. I wanted to POC it and have this topic open so I could purge it from my Todoist finally.
It'll be great to chat at DrupalCon so we have something strong and stable.
In talks with the API-First and JSON API folks, one consideration was wrapping the order data in an "envelope". Instead of it being a root property in the JSON, we could nest it. This would allow providing a "links" attribute.
So, as an example, we'd have