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

[QUESTION]怎么支持list型多属性选择 #1507

Closed
LY1806620741 opened this issue May 24, 2023 · 4 comments
Closed

[QUESTION]怎么支持list型多属性选择 #1507

LY1806620741 opened this issue May 24, 2023 · 4 comments
Labels
fixed question Further information is requested
Milestone

Comments

@LY1806620741
Copy link

LY1806620741 commented May 24, 2023

在使用多属性选取时['id','name']

正例:

json:

{
    "deep1": {
        "flightId": "MH8633",
        "column": "C",
        "row": "19"
    }
}

java:

JSONPath.extract(json,"$.deep1['row','column']")

获取返回值:

["19","C"]

反例

json:

{
    "deep1": {
         [{
            "flightId": "MH8633",
            "column": "C",
            "row": "19"
        }]
    }
}

java:

JSONPath.extract(json,"$.deep1['row','column']")

获取返回值为:

 [{
            "flightId": "MH8633",
            "column": "C",
            "row": "19"
}]

能否给个例子 https://alibaba.github.io/fastjson2/jsonpath_cn

@LY1806620741 LY1806620741 added the question Further information is requested label May 24, 2023
@LY1806620741 LY1806620741 changed the title [QUESTION]为何不支持三层以上深度的多属性选取 [QUESTION]怎么支持list型多属性选择 May 24, 2023
@LY1806620741
Copy link
Author

我现在用stream.map去做

@wenshao
Copy link
Member

wenshao commented May 27, 2023

@wenshao wenshao added this to the 2.0.33 milestone May 27, 2023
@wenshao wenshao added the fixed label May 27, 2023
@LY1806620741
Copy link
Author

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.33-SNAPSHOT/

请帮忙用2.0.33-SNAPSHOT版本验证

在我的case里它正常工作了,但因为用的是公司的数据测试,我无法提供具体的测试集

@wenshao
Copy link
Member

wenshao commented May 29, 2023

@wenshao wenshao closed this as completed May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants