1+ import Tabs from " @theme/Tabs"
2+ import TabItem from " @theme/TabItem"
3+
14<details >
25<summary ><b >Integration mapping (click to expand)</b ></summary >
6+
7+ <Tabs groupId = " integration-mapping" defaultValue = " json" values = { [
8+ { label: " JSON" , value: " json" },
9+ { label: " YAML" , value: " yaml" }
10+ ]} >
11+
12+ <TabItem value = " json" >
313``` yaml showLineNumbers title="Integration mapping JSON file"
414resources :
515 - kind : file
@@ -11,7 +21,7 @@ resources:
1121 # Replace with your repository's path_with_namespace (e.g., "group/project" or "group/subgroup/project")
1222 - group/my-project
1323 port :
14- itemsToParse : .file.content.dependencies | to_entries
24+ itemsToParse : .file.content.dependencies | to_entries
1525 entity :
1626 mappings :
1727 identifier : >-
@@ -23,7 +33,8 @@ resources:
2333 package : .item.key
2434 version : .item.value
2535` ` `
26-
36+ </TabItem>
37+ <TabItem value="yaml">
2738` ` ` yaml showLineNumbers title="Integration mapping YAML file"
2839resources :
2940 - kind : file
@@ -32,16 +43,24 @@ resources:
3243 files :
3344 path : config.yml
3445 repos :
35- - getport-labs/my-project
46+ # Replace with your repository's path_with_namespace (e.g., "group/project" or "group/subgroup/project")
47+ - group/my-project
3648 port :
49+ # Note that when parsing a YAML file, you should specify the index the parsed document.
50+ # highlight-start
51+ itemsToParse : .file.content.[0].dependencies | to_entries
52+ # highlight-end
3753 entity :
3854 mappings :
39- # Note that when parsing a YAML file, you should specify the index the parsed document.
40- identifier : .file.content.[0].identifier
41- title : .file.content.[0].title
42- blueprint : .file.content.[0].blueprint
55+ identifier : >-
56+ .item.key + "_" + if (.item.value | startswith("^")) then
57+ .item.value[1:] else .item.value end
58+ title : .item.key + "@" + .item.value
59+ blueprint : ' "package"'
4360 properties :
44- slack_channel_name : .file.content.[0].properties.slack_channel_name
45- description : .file.content.[0].properties.description
61+ package : .item.key
62+ version : .item.value
4663` ` `
64+ </TabItem>
65+ </Tabs>
4766</details>
0 commit comments