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

add reason to to cause test result? #75

Open
He-Pin opened this issue May 7, 2024 · 2 comments
Open

add reason to to cause test result? #75

He-Pin opened this issue May 7, 2024 · 2 comments

Comments

@He-Pin
Copy link

He-Pin commented May 7, 2024

    {
      "name": "double quotes, embedded U+0001",
      "selector": "$[\"\u0001\"]",
      "invalid_selector": true
    }

eg: why this is an invalid selector. which would be very helpful. a test kit should point to the spec rules.

image

@gregsdennis
Copy link
Collaborator

It's invalid because \u0001 must be JSON-encoded.

These cases are a bit confusing to read because they're also embedded in JSON, which means the string must be double-encoded.

After decoding the test, the actual path ends up being $["☺"] where is ASCII char 0x01. JSON (and by extension JSON Path) requires that this character and others be escaped.

The requirement is in the ABNF in §2.3.1.1: unescaped defines the characters which may be found unescaped in a string.

@He-Pin
Copy link
Author

He-Pin commented May 8, 2024

thanks, I find the root cause is jackson decoded it to and I have no chance to match my rule, not it fixed.

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