json icon indicating copy to clipboard operation
json copied to clipboard

Add option :allow_trailing_comma to JSON#parse

Open jspanjers opened this issue 5 years ago • 4 comments

I think it would be really nice to support JSON arrays with trailing comma's!

jspanjers avatar Jan 12 '20 19:01 jspanjers

Nice PR 🎉

I don't know if this will be accepted (since this goes beyond the stated goal of sticking to the RFC).

If not, you should consider making a json5 parser. The one I know about has 500k downloads despite saying "Experimental JSON5 Ruby parser - DO NOT USE". The specs are already written too :-)

marcandre avatar Jun 25 '20 07:06 marcandre

Note: we already deviate from the RFC, for example with NaN, so I think this PR should be accepted.

marcandre avatar Jun 25 '20 07:06 marcandre

@hsbt: can we allow this feature?

marcandre avatar Jul 03 '20 18:07 marcandre

Hi there,

I've rebased my feature branch to the current master to resolve some merge conflicts. I have also added the implementation for JRuby.

Please review this pull request again and/or approve running the workflow to run the tests.

jspanjers avatar May 27 '21 14:05 jspanjers