tidwall / tidwall/gjson

the return result has key absent problem

Open
#321 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
15.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

{
"persons": [
{
"name":"wangyiyi",
"age": 20,
"address":"china"
},
{
"name":"lisi",
"age": 33,
"address":"england"
},
{
"name":"luosan",
"age": 40,
"address":"iceland"
}
]
}
json data is above. I used the jsonpath "persons.#.[name,age,sex,address]", as you see, a give a key not exists. then gjson eat this key and just give me a result like blew:

[["wangyiyi",20,"china"],["lisi",33,"england"],["luosan",40,"iceland"]]

this behavior cause a problem that I don't know which key has no value and I can't map the existed value to it's key rightly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named in the issue. Start by reproducing the JSONPath query against the provided JSON and inspect the existing handling of missing keys in array results. Done should make missing fields distinguishable from present values without losing the other returned fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.