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
{{ message }}
Repository navigation
Allow option to ignore illegal escaped characters #939
I realize that what I'm asking is probably a long shot, but it doesn't hurt to try.
In a nutshell, v2.17.0 of the json ruby gem has broke our systems. We ingest a lot of JSON files tht contain customer-produced data. This means that we do not control the JSON that is parsed.
Before v2.17.0, everything worked without a hitch. However, after upgrading json due to it being a dependency of a gem we use, all hell broke loose, and several (over 50% for some of our major customers) JSON files stopped being ingested.
After investigating the reason, we realized it was due to having escaped characters that now fail the parsing process.
So, I was wondering if it would be possible to add an extra option to the JSON_ParserConfig struct that would allow us to keep the behavior that existed prior to v2.17.0?
Hi @byroot , this is not the same issue, because that option only handles characters under ascii code 20. Our issue is, 99% of the times, with the single quote, that is escaped \'...
Our issue is not with globally applied options (we could set the when calling JSON.parse), but with having no way to work around this.
Releases are manual. Not sure when I'll cut the next release, but I suppose you can just pin to json < 2.17.0 in your Gemfile until this new feature is release.
Activity
byroot commentedon Feb 19, 2026
Please see the discussion at #917 (comment)
In your case the best way forward is just to apply that monkey patch.
gokuu commentedon Feb 19, 2026
Hi @byroot , this is not the same issue, because that option only handles characters under ascii code 20. Our issue is, 99% of the times, with the single quote, that is escaped
\'...Our issue is not with globally applied options (we could set the when calling
JSON.parse), but with having no way to work around this.byroot commentedon Feb 19, 2026
Ah sorry, my bad. I'll look into it.
Add `allow_invalid_escape` parsing option
Add `allow_invalid_escape` parsing option
[ruby/json] Add `allow_invalid_escape` parsing option
gokuu commentedon Feb 19, 2026
Awesome! Thanks @byroot . Will this trigger a new release, or will it need to be manually done at a later date?
byroot commentedon Feb 19, 2026
Releases are manual. Not sure when I'll cut the next release, but I suppose you can just pin to
json < 2.17.0in your Gemfile until this new feature is release.gokuu commentedon Feb 19, 2026
Yes, it is currently pinned to
2.16.0.Thanks again.