Replies: 1 comment 2 replies
-
Hi Michal!
Otherwise, the recommended approach is to use a Hash: render json: {
document: OjDocumentSerializer.one(@doc),
} Not only is it more explicit and intuitive, it lends itself naturally to extension if you need to render additional properties. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello 👋
I'm experimenting with Oj::Serializer and our API using root elements in responses, even for a single record.
The issue I'm having is that I cannot make it work in Oj::Serializer.☹️
Here is my serializer
Here is my controller
The response is without a root element
Thank you
Beta Was this translation helpful? Give feedback.
All reactions