forked from atlasmap/atlasmap
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: one_to_many mapping - repeat source value based on count
Fixes: atlasmap#2276
- Loading branch information
1 parent
90017fa
commit 84fc268
Showing
11 changed files
with
326 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
lib/itests/core/src/test/resources/data/json-source-repeat.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"simpleField": "simpleFieldValue", | ||
"rootArray":[ | ||
{ | ||
"arrayField": "" | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
lib/itests/core/src/test/resources/data/json-source-repeat_count_3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"simpleField": "simpleFieldValue", | ||
"rootArray":[ | ||
{ | ||
"arrayField": "" | ||
}, | ||
{ | ||
"arrayField": "" | ||
}, | ||
{ | ||
"arrayField": "" | ||
} | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
lib/itests/core/src/test/resources/data/json-source-repeat_for_nested_collection_field.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"simpleField": "simpleFieldValue", | ||
"rootArray": [ | ||
{ | ||
"nestedArray": [ | ||
{ | ||
"arrayField": "dt1" | ||
}, | ||
{ | ||
"arrayField": "dt2" | ||
}, | ||
{ | ||
"arrayField": "dt2" | ||
} | ||
] | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
lib/itests/core/src/test/resources/data/json-source-repeat_no_field.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"simpleField": "simpleFieldValue", | ||
"rootArray":[ | ||
{ | ||
} | ||
] | ||
} |
70 changes: 70 additions & 0 deletions
70
...e/src/test/resources/mappings/atlasmapping-multiplicity-transformation-action_repeat.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"AtlasMapping": { | ||
"jsonType": "io.atlasmap.v2.AtlasMapping", | ||
"dataSource": [ | ||
{ | ||
"jsonType": "io.atlasmap.json.v2.JsonDataSource", | ||
"id": "json-source-repeat", | ||
"uri": "atlas:json:json-source-repeat", | ||
"dataSourceType": "SOURCE" | ||
}, | ||
{ | ||
"jsonType": "io.atlasmap.json.v2.JsonDataSource", | ||
"id": "json-target", | ||
"uri": "atlas:json:json-target", | ||
"dataSourceType": "TARGET" | ||
} | ||
], | ||
"mappings": { | ||
"mapping": [ | ||
{ | ||
"jsonType": "io.atlasmap.v2.Mapping", | ||
"expression": "REPEAT(count(${json-source-repeat:/rootArray<>/arrayField}), ${json-source-repeat:/simpleField})", | ||
"inputFieldGroup": { | ||
"jsonType": "io.atlasmap.v2.FieldGroup", | ||
"field": [ | ||
{ | ||
"jsonType": "io.atlasmap.json.v2.JsonField", | ||
"docId": "json-source-repeat", | ||
"index": 0, | ||
"path": "/simpleField", | ||
"fieldType": "STRING", | ||
"name": "simpleField" | ||
}, | ||
{ | ||
"jsonType": "io.atlasmap.json.v2.JsonField", | ||
"docId": "json-source-repeat", | ||
"index": 1, | ||
"path": "/rootArray<>/arrayField", | ||
"fieldType": "STRING", | ||
"name": "DT" | ||
} | ||
] | ||
}, | ||
"inputField" : [ ], | ||
"outputField": [ | ||
{ | ||
"jsonType": "io.atlasmap.json.v2.JsonField", | ||
"docId": "json-target", | ||
"index": 0, | ||
"path": "/[]/targetField", | ||
"fieldType": "STRING", | ||
"name": "targetField" | ||
} | ||
], | ||
"id": "mapping.88333" | ||
} | ||
] | ||
}, | ||
"lookupTables": { | ||
"lookupTable": [] | ||
}, | ||
"constants": { | ||
"constant": [] | ||
}, | ||
"properties": { | ||
"property": [] | ||
}, | ||
"name": "UI.158101" | ||
} | ||
} |
Oops, something went wrong.