Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests.json fails to parse #35

Open
gregsdennis opened this issue Sep 19, 2017 · 2 comments
Open

Tests.json fails to parse #35

gregsdennis opened this issue Sep 19, 2017 · 2 comments

Comments

@gregsdennis
Copy link

gregsdennis commented Sep 19, 2017

There is a test (below) that deals with duplicate keys. While not explicitly forbidden by JSON, many implementations may error when attempting to parse this:

{
    "comment": "duplicate ops",
    "doc": { "foo": "bar" },
    "patch": [ 
        {
            "op": "add",
            "path": "/baz",
            "value": "qux",
            "op": "move",
            "from":"/foo"
        }
    ],
    "error": "patch has two 'op' members",
    "disabled": true
}

The fact that it's marked as disabled doesn't help because, for these implementations, the JSON itself can't be read. Thus the failure occurs before the test, not as a result of it.

For additional context, this StackOverflow answer on duplicate keys is really nice.

@mnot
Copy link
Member

mnot commented Oct 30, 2019

We can segregate this into a different file if it causes parsing to fail.

What implementation(s) are you seeing that with?

@gregsdennis
Copy link
Author

gregsdennis commented Oct 31, 2019

Mine: Manatee.Json, though I have an option for duplicate key behavior. Still, I can only say to throw, ignore, or overwrite. I can't handle the presence of duplicate keys.

I'd be surprised if there aren't others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants