Skip to content

Commit 5783762

Browse files
authored
Merge pull request #24 from mtseluiko/fix/fe-missing-extensions
FE: fix missing scopes extensions
2 parents f7f5afa + a024488 commit 5783762

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

forward_engineering/helpers/pathHelper.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function getRequestData(collections, containers, containerId, containersPath = [
6262
methodName: data.collectionName,
6363
isActivated: data.isActivated
6464
};
65-
const extensions = getExtensions(data.operationExtensions);
65+
const extensions = getExtensions(data.scopesExtensions);
6666

6767
return Object.assign({}, request, extensions);
6868
})
@@ -103,9 +103,10 @@ function mapResponses(collections, collectionId, isParentActivated) {
103103
.map(collection => {
104104
const responseCode = collection.collectionName;
105105
const shouldResponseBeCommented = !collection.isActivated && isParentActivated;
106+
const extensions = getExtensions(collection.scopesExtensions);
106107
const response = mapResponse(get(collection, 'properties.response'), collection.description, shouldResponseBeCommented);
107108

108-
return { responseCode, response };
109+
return { responseCode, response: { ...response, ...extensions } };
109110
})
110111
.reduce((acc, { responseCode, response }) => {
111112
acc[responseCode] = response;
@@ -137,8 +138,9 @@ function getCallbacks(data, containers, containerId, containersPath = []) {
137138
containers,
138139
[...containersPath, containerId]
139140
);
141+
const extensions = getExtensions(value.scopesExtensions);
140142

141-
return { [key]: { [value.callbackExpression]: callbackData }};
143+
return { [key]: { [value.callbackExpression]: callbackData, ...extensions }};
142144

143145
})
144146
.reduce((acc, item) => {

forward_engineering/helpers/typeHelper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ function getTypeProps(data, key) {
5555
xml: getXml(data.xml)
5656
};
5757
const objectChoices = getChoices(data, key);
58+
const extensions = getExtensions(data.scopesExtensions);
5859

59-
return Object.assign({}, objectProps, objectChoices);
60+
return Object.assign({}, objectProps, objectChoices, extensions);
6061
}
6162
case 'parameter':
6263
if (!properties || properties.length === 0) {

properties_pane/field_level/fieldLevelConfig.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,11 @@ making sure that you maintain a proper JSON format.
14321432
"template": "textarea",
14331433
"markdown": false
14341434
}
1435-
]
1435+
],
1436+
"dependency": {
1437+
"key": "subtype",
1438+
"value": "schema"
1439+
}
14361440
},
14371441
"comments"
14381442
],
@@ -2566,6 +2570,31 @@ making sure that you maintain a proper JSON format.
25662570
]
25672571
}
25682572
]
2573+
},
2574+
{
2575+
"propertyName": "extensions",
2576+
"propertyType": "group",
2577+
"propertyKeyword": "scopesExtensions",
2578+
"shouldValidate": true,
2579+
"propertyTooltip": "",
2580+
"structure": [
2581+
{
2582+
"propertyName": "pattern",
2583+
"propertyKeyword": "extensionPattern",
2584+
"shouldValidate": true,
2585+
"propertyType": "text",
2586+
"regex":"^x-"
2587+
},
2588+
{
2589+
"propertyName": "value",
2590+
"propertyKeyword": "extensionValue",
2591+
"propertyValidate": false,
2592+
"propertyTooltip": "Popup for multi-line text entry",
2593+
"propertyType": "details",
2594+
"template": "textarea",
2595+
"markdown": false
2596+
}
2597+
]
25692598
}
25702599
],
25712600
"expression": [

snippets/encoding.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "encoding",
3-
"subtype": "snippetChildrenOnly",
43
"parentType": "document",
54
"properties": [{
65
"name": "headers",

types/encoding.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
"minProperties": "",
1515
"maxProperties": "",
1616
"snippet": "encoding",
17+
"properties": [],
1718
"additionalProperties": false,
1819
"enum": [],
20+
"subtype": "snippetChildrenOnly",
1921
"hackoladeMeta": {
2022
"disableAdd": true
2123
}

0 commit comments

Comments
 (0)