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
Is this expected? I expected Oj to behave like JSON.generate here. If this is intended, is there an option to mimic the JSON behavior? I looked through the docs but nothing stood out as relevant to me.
I ran into this working with Sequel's pg_array extension which wraps Array via DelegateClass.
The text was updated successfully, but these errors were encountered:
Oj is not replacement for the JSON gem by default. You have to use the :compat mode to make it act like the JSON gem. The default mode is object serialization mode. Take a look at the docs here http://ohler.com/oj/doc/file.Modes.html.
Thanks! After reading that doc (and the linked compat doc), I'm still not clear on the difference between mode: :compat and mimic_JSON, but mimic_JSON appears to resolve my issue.
I ran into an issue where Oj is not serializing a DelegateClass as I expected. I was able to minimize the test case to something pretty simple:
the output is:
Is this expected? I expected Oj to behave like
JSON.generate
here. If this is intended, is there an option to mimic theJSON
behavior? I looked through the docs but nothing stood out as relevant to me.I ran into this working with Sequel's pg_array extension which wraps
Array
viaDelegateClass
.The text was updated successfully, but these errors were encountered: