Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions forward_engineering/helpers/pathHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getRequestData(collections, containers, containerId, containersPath = [
methodName: data.collectionName,
isActivated: data.isActivated
};
const extensions = getExtensions(data.operationExtensions);
const extensions = getExtensions(data.scopesExtensions);

return Object.assign({}, request, extensions);
})
Expand Down Expand Up @@ -103,9 +103,10 @@ function mapResponses(collections, collectionId, isParentActivated) {
.map(collection => {
const responseCode = collection.collectionName;
const shouldResponseBeCommented = !collection.isActivated && isParentActivated;
const extensions = getExtensions(collection.scopesExtensions);
const response = mapResponse(get(collection, 'properties.response'), collection.description, shouldResponseBeCommented);

return { responseCode, response };
return { responseCode, response: { ...response, ...extensions } };
})
.reduce((acc, { responseCode, response }) => {
acc[responseCode] = response;
Expand Down Expand Up @@ -137,8 +138,9 @@ function getCallbacks(data, containers, containerId, containersPath = []) {
containers,
[...containersPath, containerId]
);
const extensions = getExtensions(value.scopesExtensions);

return { [key]: { [value.callbackExpression]: callbackData }};
return { [key]: { [value.callbackExpression]: callbackData, ...extensions }};

})
.reduce((acc, item) => {
Expand Down
9 changes: 6 additions & 3 deletions forward_engineering/helpers/typeHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function getType(data, key) {
function getTypeProps(data, key) {
const { type, properties, items, required } = data;

const extensions = getExtensions(data.scopesExtensions);

switch (type) {
case 'array': {
const arrayProps = {
Expand All @@ -37,7 +39,7 @@ function getTypeProps(data, key) {
};
const arrayChoices = getChoices(data, key);

return Object.assign({}, arrayProps, arrayChoices);
return Object.assign({}, arrayProps, arrayChoices, extensions);
}
case 'object': {
const objectProps = {
Expand All @@ -56,7 +58,7 @@ function getTypeProps(data, key) {
};
const objectChoices = getChoices(data, key);

return Object.assign({}, objectProps, objectChoices);
return Object.assign({}, objectProps, objectChoices, extensions);
}
case 'parameter':
if (!properties || properties.length === 0) {
Expand Down Expand Up @@ -167,7 +169,8 @@ function getPrimitiveTypeProps(data) {
maxLength: data.maxLength,
multipleOf: data.multipleOf,
xml: getXml(data.xml),
example: data.sample
example: data.sample,
...getExtensions(data.scopesExtensions)
};

return addIfTrue(properties, 'nullable', data.nullable);
Expand Down
31 changes: 30 additions & 1 deletion properties_pane/field_level/fieldLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,11 @@ making sure that you maintain a proper JSON format.
"template": "textarea",
"markdown": false
}
]
],
"dependency": {
"key": "subtype",
"value": "schema"
}
},
"comments"
],
Expand Down Expand Up @@ -2566,6 +2570,31 @@ making sure that you maintain a proper JSON format.
]
}
]
},
{
"propertyName": "extensions",
"propertyType": "group",
"propertyKeyword": "scopesExtensions",
"shouldValidate": true,
"propertyTooltip": "",
"structure": [
{
"propertyName": "pattern",
"propertyKeyword": "extensionPattern",
"shouldValidate": true,
"propertyType": "text",
"regex":"^x-"
},
{
"propertyName": "value",
"propertyKeyword": "extensionValue",
"propertyValidate": false,
"propertyTooltip": "Popup for multi-line text entry",
"propertyType": "details",
"template": "textarea",
"markdown": false
}
]
}
],
"expression": [
Expand Down
1 change: 0 additions & 1 deletion snippets/encoding.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "encoding",
"subtype": "snippetChildrenOnly",
"parentType": "document",
"properties": [{
"name": "headers",
Expand Down
2 changes: 2 additions & 0 deletions types/encoding.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"minProperties": "",
"maxProperties": "",
"snippet": "encoding",
"properties": [],
"additionalProperties": false,
"enum": [],
"subtype": "snippetChildrenOnly",
"hackoladeMeta": {
"disableAdd": true
}
Expand Down