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
I've had good luck using a :reader with the right index, however the :writer is passed a JSON object ({}) instead of an array ([]), so my output JSON looks more like:
cool avatar :) it's not supported out-of-the-box. However, just anything can be achieved with representable 🍷
This is a very special representation - the consumer needs to have knowledge about position and semantic of every item. The order matters here, right?
If I had to do that now, I'd have an intermediate object that transforms my data model into an array and back... Is that array the document itself, or is that a nested property? Damn, I wanted to chill out tonight now you made me think how to implement that......
This is only one way but gives you an idea. I'm not really sure how I'd support that from representable......... maybe I need to know the answers to the questions above first.
Is it possible to represent an object as a heterogeneous, index-based, JSON array, instead of a JSON object (hash)?
So instead of the following:
I'd like to use the following:
I've had good luck using a
:reader
with the right index, however the:writer
is passed a JSON object ({}
) instead of an array ([]
), so my output JSON looks more like:Is this supported?
The text was updated successfully, but these errors were encountered: