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

Attempting to access a property value with an @ sign. #24

Open
GoogleCodeExporter opened this issue Sep 16, 2015 · 0 comments
Open

Attempting to access a property value with an @ sign. #24

GoogleCodeExporter opened this issue Sep 16, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Attempting to access a property value with an @ sign.

The query is dynamically built and needs to be able to evaluate any string. 
What steps will reproduce the problem?
1. Using this object

{
"report": {
    "Author": [
        {
            "value": "John",
            "count": "58",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "12314"

                },
                {
                    "key": "Date",
                    "value": "2000-01-01"
                }
            ]
        },
        {
            "value": "Jane",
            "count": "1",
            "fields": [
            ]
        },
        {
            "value": "Foo@bar.com",
            "count": "58",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "12314"

                },
                {
                    "key": "Date",
                    "value": "2000-01-01"
                },
                {
                    "key": "tags",
                    "value": "a,b,c,d"
                }         
            ]
        },
        {
            "value": "Bill",
            "count": "2",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "14"

                }
            ]
        }
    ]
}
}

2. Using this path

$.report.Author[?(@.value==='Foo@bar.com')]

What is the expected output? What do you see instead?
Expected - [{
            "value": "Foo@bar.com",
            "count": "58",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "12314"

                },
                {
                    "key": "Date",
                    "value": "2000-01-01"
                },
                {
                    "key": "tags",
                    "value": "a,b,c,d"
                }         
            ]
        }]

Actual result - False

What version of the product are you using? On what operating system?
JSONPath 0.8.0
Windows Server 2008 R2 - IIS 7.5

Please provide any additional information below.

I've also tried 
$.report.Author[?(@.value==='\Foo@bar.com\')] with no luck.

Since the value can actually be any string I can't escape in string.

Original issue reported on code.google.com by Medros1...@gmail.com on 1 Oct 2012 at 7:02

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

No branches or pull requests

1 participant