Skip to content

Allow option to ignore illegal escaped characters #939

Closed

Description

@gokuu

Hello!

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?

Activity

  1. byroot commented on Feb 19, 2026

    @byroot
    Member

    Please see the discussion at #917 (comment)

    In your case the best way forward is just to apply that monkey patch.

  2. gokuu commented on Feb 19, 2026

    @gokuu
    Author

    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.

  3. reopened this on Feb 19, 2026
  4. byroot commented on Feb 19, 2026

    @byroot
    Member

    Ah sorry, my bad. I'll look into it.

  5. gokuu commented on Feb 19, 2026

    @gokuu
    Author

    Awesome! Thanks @byroot . Will this trigger a new release, or will it need to be manually done at a later date?

  6. byroot commented on Feb 19, 2026

    @byroot
    Member

    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.

  7. gokuu commented on Feb 19, 2026

    @gokuu
    Author

    Yes, it is currently pinned to 2.16.0.
    Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions