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

Fix issue when filtering nested array #2

Merged
merged 5 commits into from
Apr 21, 2022
Merged

Fix issue when filtering nested array #2

merged 5 commits into from
Apr 21, 2022

Conversation

tiopramayudi
Copy link
Member

We found bugs where the jsonpath is not working as expectedly when dealing with nested array. Suppose you have

{
    "inputs": [
        {
            "variable": [
                {
                    "name": "A",
                    "value": 200
                },
                {
                    "name": "B",
                    "value": 250
                }
            ]
        },
        {
            "variable": [
                {
                    "name": "C",
                    "value": 300
                },
                {
                    "name": "D",
                    "value": 350
                }
            ]
        }
    ]
}

This path $.inputs[*].variable[?(@.value > 200)].value should return

[ 250, 300, 350]

but current returning

[[250], [300, 350]]

This result is happening because there is no flattening for range or filter operation

@pradithya
Copy link

Can you remove parse_filter_v1? It seems a dead code.

@tiopramayudi
Copy link
Member Author

Can you remove parse_filter_v1? It seems a dead code.

done

Copy link

@pradithya pradithya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tiopramayudi tiopramayudi merged commit bb91a19 into gojekfarm:master Apr 21, 2022
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

Successfully merging this pull request may close these issues.

2 participants