I have a Rails backend using postgresql jsonb field. I would like to use the gem fast_jsonapi
but am not married to it.
I have a jsonb field that is pretty much the model I want to serialize. However, I haven't figured out how to make json attributes of them (serialize them as first class citizens.) So, instead of:
{
"attributes":{
"data":{
"title":"ok",
"author":"masta p"
},
"created_at":"2019-02-16T17:40:21.477Z",
"updated_at":"2019-02-16T17:40:21.477Z"
}
}
I don't need the extra 'data' namespace and would like it to be:
{
"attributes":{
"title":"ok",
"author":"masta p"
"created_at":"2019-02-16T17:40:21.477Z",
"updated_at":"2019-02-16T17:40:21.477Z"
}
}
What's a low cost way of doing this?