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
This works on the root object, which has an array of children, but the children comments do not themselves have any children render. The "children" field is completely absent from the json response.
I was reading issue #73 which is related, has there been any progress on this?
EDIT: Using a string for the class name does not resolve the issue.
The text was updated successfully, but these errors were encountered:
I am not sure what the impact to performance this would have, but it seems to be working with no issues for now. Let me know if there is a better way of doing this, I would think this is quite a common use case.
First I am sorry for long reply time, I have looked at the bug here and looks like this happen because I am building a "serialization descriptor" (contains attributes, associations and their serializer info) ahead of time and not lazily, from first look it looks like a big one to fix.
I'll try to experiment with multiple options to solve this, but don't have promise of solution for the near-time.
Regarding your suggested solution, it works, but it's not efficient as it could be, since has_many builds the json-string incrementally (using Oj::StringWriter) and with your approach it will serialize the children to array of hashes and then to JSON. I might be able to have quick release to address by doing something like:
Hi,
I'm trying to serialize this object, which may contain instances of itself as children, e.g:
This works on the root object, which has an array of children, but the children comments do not themselves have any children render. The "children" field is completely absent from the json response.
I was reading issue #73 which is related, has there been any progress on this?
EDIT: Using a string for the class name does not resolve the issue.
The text was updated successfully, but these errors were encountered: