mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
explode when outputting to json
This commit is contained in:
@@ -24,9 +24,7 @@ type OperationType struct {
|
||||
// - documentIndex - retrieves document index, can be used with select
|
||||
// - mergeAppend (merges and appends arrays)
|
||||
// - mergeEmpty (sets only if the document is empty, do I do that now?)
|
||||
// - updateStyle - not recursive
|
||||
// - updateTag - not recursive
|
||||
// - explodeAnchors
|
||||
// - compare ??
|
||||
// - validate ??
|
||||
// - exists
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
//nested alias
|
||||
|
||||
var explodeTest = []expressionScenario{
|
||||
{
|
||||
document: `{a: mike}`,
|
||||
@@ -37,6 +35,15 @@ var explodeTest = []expressionScenario{
|
||||
"D0, P[foobar], (!!map)::{c: foo_c, a: foo_a, thing: foobar_thing}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
document: mergeDocSample,
|
||||
expression: `.foo* | explode(explode(.)) | (. style="flow")`,
|
||||
expected: []string{
|
||||
"D0, P[foo], (!!map)::{a: foo_a, thing: foo_thing, c: foo_c}\n",
|
||||
"D0, P[foobarList], (!!map)::{b: bar_b, a: foo_a, thing: bar_thing, c: foobarList_c}\n",
|
||||
"D0, P[foobar], (!!map)::{c: foo_c, a: foo_a, thing: foobar_thing}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
document: `{f : {a: &a cat, b: &b {f: *a}, *a: *b}}`,
|
||||
expression: `explode(.f)`,
|
||||
|
||||
Reference in New Issue
Block a user