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

get null when element not exists #978

Open
chenwenhang opened this issue Jan 7, 2024 · 0 comments
Open

get null when element not exists #978

chenwenhang opened this issue Jan 7, 2024 · 0 comments

Comments

@chenwenhang
Copy link

Hello
My json:

{
  "showapi_res_error": "",
  "showapi_res_id": "6597a2f5fb638cf45b4d460c",
  "showapi_res_code": 0,
  "showapi_fee_num": 1,
  "showapi_res_body": {
    "list": [
      {
        "time": "14:26:57",
        "zhesuan": "193.69",
        "hui_out": "195.91",
        "chao_in": "192.95",
        "chao_out": "199.47",
        "hui_in": "194.55",
        "day": "2024-01-05"
      },
      {
        "time": "14:26:57",
        "zhesuan": "477.56",
        "code": "AUD",
        "hui_out": "481.77",
        "chao_in": "478.08",
        "chao_out": "483.16",
        "hui_in": "478.57",
        "day": "2024-01-05",
        "kkk": {"aaa":"bbb"}
      }
    ],
    "listSize": 28,
    "ret_code": 0
  }
}

I try to get all code and kkk.aaa from this json. I have set DEFAULT_PATH_LEAF_TO_NULL, the result is as follows:

$.showapi_res_body.list.*.name
[null, "AUD"] // right

$.showapi_res_body.list.*.kkk.aaa
["bbb"] // wrong, expect: [null, "bbb]

How may I get all kkk.aaa from this json including null?

Thanx!

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

1 participant