CGI-FR / CGI-FR/jsonline

feat: add wildcard selection for leaf objects

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

With this input JSON document

```json
{
"designation": "Acme Inc.",
"adresseSiègeSocial": {
"NumeroRue": "123",
"NomRue": "Main St.",
"CodePostal": "12345",
"Ville": "Anytown"
},
"employe": [
{
"Nom": "Jane",
"Prenom": "Doe",
"dateNaissance": "01-01-1970",
"LieuNaissance": "Anytown",
"NombreEnfants": 1,
"enfant": [
{
"Prenom": "John",
"DateNaissance": "01-01-2000",
"LieuNaissance": "Anytown"
},
{
"Prenom": "Jack",
"DateNaissance": "01-01-2002",
"LieuNaissance": "Anytown"
}
]
}
]
}
```

`FindValuesAtPath("employe.enfant")` should return
```json
[
[
{
"Prenom": "John",
"DateNaissance": "01-01-2000",
"LieuNaissance": "Anytown"
},
{
"Prenom": "Jack",
"DateNaissance": "01-01-2002",
"LieuNaissance": "Anytown"
}
]
]
```

`FindValuesAtPath("employe.enfant.*")` should return
```json
[
{
"Prenom": "John",
"DateNaissance": "01-01-2000",
"LieuNaissance": "Anytown"
},
{
"Prenom": "Jack",
"DateNaissance": "01-01-2002",
"LieuNaissance": "Anytown"
}
]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.