forest-rails icon indicating copy to clipboard operation
forest-rails copied to clipboard

Use `JSON.pretty_generate` to serialize the schema

Open Flink opened this issue 5 years ago • 0 comments

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.

Flink avatar Jul 16 '19 12:07 Flink