Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

[bug] JSONPath.extract(str, "$.result[0,2].puid")解析异常 #3493

@huo-feng-ding

Description

@huo-feng-ding

{
"result": [
{
"puid": "21025318"
},
{
"puid": "21482682"
},
{
"puid": "21025345"
}
],
"state": 0
}

JSONPath.extract(str, "$.result[0,2].puid")报异常
java.lang.UnsupportedOperationException
at com.alibaba.fastjson.JSONPath$MultiIndexSegment.extract(JSONPath.java:2694)
at com.alibaba.fastjson.JSONPath.extract(JSONPath.java:179)
at com.alibaba.fastjson.JSONPath.extract(JSONPath.java:698)
at com.alibaba.fastjson.JSONPath.extract(JSONPath.java:704)

使用JSONPath.eval(jsonObject, "$.result[0,2].puid") 正常

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions