Skip to content

Some strict mode issues #980

Description

@eleumik

Hi,

while performing tests on read-only behavior of many JSON parsers I found some issues with this library, testing strict mode only.

The following are all "forgiven":

{"a":True}
{"a":TRUE}
{true : 3}
{TRUE : 3}
{1 : 3}

I noticed occurrences of [equalsIgnoreCase] around the code, which I suspect is the origin. You’ll know better than me, but probably you just need a helper method to choose (equals) based on context and value. The [true] or [1] key cases, I’m not sure about.

Also, this shouldn’t parse in strict mode, I believe:

{ "a" : 0. }

The good news: only 9 failures out of 124 tests for this lib (only Jackson at zero, after some config and a custom wrapper for duplicate keys, not little work). Fixing these would resolve 6 failures. Of the remaining 3: 2 are for multiple roots ({} {}), and 1 for ({"a":[,4,null,8]}) where the first item is treated as JSON-null; some libs skip it, some (correctly, I think) fail.

Thanks,
Michele Vivoda

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions