-
Notifications
You must be signed in to change notification settings - Fork 8
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
deepscan issue #15
Comments
Working on a fix |
Fixed in release 1.0.5 |
thanks |
jsonslice.Get(data, "$.spec.containers[:]") gives the expected result: [{ BUT: jsonslice.Get(data, "$..spec.containers[:]") gives double square brackets. [[{ is it the expected result for deep scan? |
It is, because |
so it is as designed. thanks |
two similar jsonpath queries give different results:
data:=[]byte(
{ "apiVersion": "v1", "kind": "Pod", "spec": { "containers": [ { "name": "c1", "image": "busybox", "resources": { "limits": { "cpu": "2" } } }, { "name": "c2", "image": "busybox", "resources": { "limits": { "cpu": "2" } } } ] } }
)jsonslice.Get(data, "$.spec.containers[:]")
gives the expected result:
[{
"name": "c1",
"image": "busybox",
"resources": {
"limits": {
"cpu": "2"
}
}
},{
"name": "c2",
"image": "busybox",
"resources": {
"limits": {
"cpu": "2"
}
}
}]
BUT:
jsonslice.Get(data, "$..spec.containers[:]")
gives:
[{
"containers": [
{
"name": "c1",
"image": "busybox",
"resources": {
"limits": {
"cpu": "2"
}
}
},
{
"name": "c2",
"image": "busybox",
"resources": {
"limits": {
"cpu": "2"
}
}
}
]
}]
The text was updated successfully, but these errors were encountered: