diff options
Diffstat (limited to 'test/json-mapped/nested-repeats')
-rw-r--r-- | test/json-mapped/nested-repeats/check.txt | 64 | ||||
-rw-r--r-- | test/json-mapped/nested-repeats/input.json | 45 | ||||
-rw-r--r-- | test/json-mapped/nested-repeats/map.json | 22 |
3 files changed, 131 insertions, 0 deletions
diff --git a/test/json-mapped/nested-repeats/check.txt b/test/json-mapped/nested-repeats/check.txt new file mode 100644 index 0000000..c089547 --- /dev/null +++ b/test/json-mapped/nested-repeats/check.txt @@ -0,0 +1,64 @@ +nested repeats/3/2:string:"A" +nested repeats/3/3:numeric:1000 +nested repeats/3/4:string:"A123456789" +nested repeats/3/5:string:"en-US" +nested repeats/4/2:string:"A" +nested repeats/4/3:numeric:1001 +nested repeats/4/4:string:"A987654321" +nested repeats/4/5:string:"en-US" +nested repeats/5/2:string:"B" +nested repeats/5/3:numeric:2000 +nested repeats/5/4:string:"B123456789" +nested repeats/5/5:string:"ja-JP" +nested repeats/6/2:string:"B" +nested repeats/6/3:numeric:2001 +nested repeats/6/4:string:"B987654321" +nested repeats/6/5:string:"ja-JP" +nested repeats/7/2:string:"B" +nested repeats/7/3:numeric:2002 +nested repeats/7/4:string:"B987654323" +nested repeats/7/5:string:"ja-JP" +nested repeats/8/2:string:"C" +nested repeats/8/3:numeric:3000 +nested repeats/8/4:string:"C123456789" +nested repeats/8/5:string:"fr-CA" +nested repeats/9/2:string:"C" +nested repeats/9/3:numeric:3001 +nested repeats/9/4:string:"C987654320" +nested repeats/9/5:string:"fr-CA" +nested repeats/10/2:string:"C" +nested repeats/10/3:numeric:3002 +nested repeats/10/4:string:"C987654321" +nested repeats/10/5:string:"fr-CA" +nested repeats/11/2:string:"C" +nested repeats/11/3:numeric:3003 +nested repeats/11/4:string:"C987654322" +nested repeats/11/5:string:"fr-CA" +nested repeats/12/2:string:"C" +nested repeats/12/3:numeric:3004 +nested repeats/12/4:string:"C987654323" +nested repeats/12/5:string:"fr-CA" +nested repeats/13/2:string:"C" +nested repeats/13/3:numeric:3005 +nested repeats/13/4:string:"C987654324" +nested repeats/13/5:string:"fr-CA" +nested repeats/14/2:string:"C" +nested repeats/14/3:numeric:3006 +nested repeats/14/4:string:"C987654325" +nested repeats/14/5:string:"fr-CA" +nested repeats/15/2:string:"D" +nested repeats/15/3:numeric:4000 +nested repeats/15/4:string:"D123456789" +nested repeats/15/5:string:"unknown" +nested repeats/16/2:string:"E" +nested repeats/17/2:string:"F" +nested repeats/17/3:numeric:6000 +nested repeats/17/4:string:"F123456789" +nested repeats/18/2:string:"G" +nested repeats/18/3:numeric:7000 +nested repeats/18/4:string:"G123456789" +nested repeats/18/5:string:"en-GB" +nested repeats/19/2:string:"G" +nested repeats/19/3:numeric:7000 +nested repeats/19/4:string:"G123456780" +nested repeats/19/5:string:"en-GB" diff --git a/test/json-mapped/nested-repeats/input.json b/test/json-mapped/nested-repeats/input.json new file mode 100644 index 0000000..d755f45 --- /dev/null +++ b/test/json-mapped/nested-repeats/input.json @@ -0,0 +1,45 @@ +{ + "data": [ + {"category": "A", "region": "en-US", + "records": [ + {"id": 1000, "ref": "A123456789"}, + {"id": 1001, "ref": "A987654321"} + ] + }, + {"category": "B", "region": "ja-JP", + "records": [ + {"id": 2000, "ref": "B123456789"}, + {"id": 2001, "ref": "B987654321"}, + {"id": 2002, "ref": "B987654323"} + ] + }, + {"category": "C", "region": "fr-CA", + "records": [ + {"id": 3000, "ref": "C123456789"}, + {"id": 3001, "ref": "C987654320"}, + {"id": 3002, "ref": "C987654321"}, + {"id": 3003, "ref": "C987654322"}, + {"id": 3004, "ref": "C987654323"}, + {"id": 3005, "ref": "C987654324"}, + {"id": 3006, "ref": "C987654325"} + ] + }, + {"category": "D", "region": "unknown", + "records": [ + {"id": 4000, "ref": "D123456789"}, + ] + }, + {"category": "E", "records": []}, + {"category": "F", + "records": [ + {"id": 6000, "ref": "F123456789"} + ] + }, + {"category": "G", "region": "en-GB", + "records": [ + {"id": 7000, "ref": "G123456789"}, + {"id": 7000, "ref": "G123456780"} + ] + } + ] +}
\ No newline at end of file diff --git a/test/json-mapped/nested-repeats/map.json b/test/json-mapped/nested-repeats/map.json new file mode 100644 index 0000000..668863e --- /dev/null +++ b/test/json-mapped/nested-repeats/map.json @@ -0,0 +1,22 @@ +{ + "sheets": ["nested repeats"], + + "ranges": [ + {"sheet": "nested repeats", + "row": 3, + "column": 2, + + "fields": [ + {"path": "$['data'][]['category']"}, + {"path": "$['data'][]['records'][]['id']"}, + {"path": "$['data'][]['records'][]['ref']"}, + {"path": "$['data'][]['region']"} + ], + + "row-groups": [ + {"path": "$['data']"}, + {"path": "$['data'][]['records']"} + ] + } + ] +} |