forest-rails
forest-rails copied to clipboard
Use `JSON.pretty_generate` to serialize the schema
As we where changing the lib we were using for outputting JSON to use the Oj
gem, the schema suddenly failed to load.
It seems the reason is that it was not serialized properly in the first place as there are some invalid JSON generated when using regexps. Instead of relying on custom code to output the schema, this patch uses JSON.pretty_generate
from the ruby stdlib (available from 2.2 series at least) which I think will output something very similar but without any problems regarding serialization.