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
indent is applied, but space is not. I found this to be true for other options such as array_nl, which appears to be ignored. I also tried using :custom mode, which equally ignores these options.
The text was updated successfully, but these errors were encountered:
Options are supported according the the specified mode or the mode in the default options. Note that if mimic_JSON or Oj.optimize_rails has not been called then the behavior of the modes may not be the same as if they were.
I'm not sure what the second sentence suggests; could that be the reason? I am not calling into either of those.
StringWriter and StreamWriter are meant as a convenient way to write JSON without creating a bunch of Ruby objects. Currently it does not support the special dump options. I had no plans to expand the capabilities as the idea was to keep the writer fast and adding the various options would add additional overhead. Maybe I should update the docs to make that clear. My apologies.
According to https://github.com/ohler55/oj/blob/v3.10.6/pages/Modes.md, the
:rails
mode should support thespace
formatting option. However, this does not seem to work when using aStringWriter
; only some of the options given below are applied:indent
is applied, butspace
is not. I found this to be true for other options such asarray_nl
, which appears to be ignored. I also tried using:custom
mode, which equally ignores these options.The text was updated successfully, but these errors were encountered: