diff --git a/modules/openapi-generator/src/main/resources/zapier/package.mustache b/modules/openapi-generator/src/main/resources/zapier/package.mustache index 9759b8520ee..4d24a12a7a1 100644 --- a/modules/openapi-generator/src/main/resources/zapier/package.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/package.mustache @@ -13,7 +13,7 @@ }, "dependencies": { "lodash": "^4.17.21", - "zapier-platform-core": "15.0.1", + "zapier-platform-core": "15.4.1", "form-data": "2.1.4" }, "devDependencies": { @@ -22,6 +22,6 @@ }, "private": true, "zapier": { - "convertedByCLIVersion": "14.1.1" + "convertedByCLIVersion": "15.4.1" } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/zapier/utils.mustache b/modules/openapi-generator/src/main/resources/zapier/utils.mustache index a73f00e4778..201a15fb582 100644 --- a/modules/openapi-generator/src/main/resources/zapier/utils.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/utils.mustache @@ -1,14 +1,14 @@ const _ = require('lodash') const replacePathParameters = (url) => url.replace(/{([^{}]+)}/g, (keyExpr, key) => `{{bundle.inputData.${key}}}`) -const childMapping = (objectsArray, prefix, model) => objectsArray.map(object => model.mapping({inputData: object}, prefix)) +const childMapping = (objectsArray, prefix, model) => objectsArray ? objectsArray.map(object => model.mapping({inputData: object}, prefix)) : undefined const removeIfEmpty = (obj) => _.isEmpty(JSON.parse(JSON.stringify(obj))) ? undefined : obj const buildKeyAndLabel = (prefix, isInput = true, isArrayChild = false) => { const keyPrefix = !_.isEmpty(prefix) && (!isArrayChild || isInput) ? `${prefix}${isInput ? '.' : '__'}` : prefix const labelPrefix = !_.isEmpty(keyPrefix) ? keyPrefix.replaceAll('__', '.') : '' return { keyPrefix: keyPrefix, - labelPrefix:labelPrefix, + labelPrefix: labelPrefix, } } const isSearchAction = (key) => { diff --git a/samples/client/petstore/zapier/package.json b/samples/client/petstore/zapier/package.json index 415649542cc..961f5a6d84c 100644 --- a/samples/client/petstore/zapier/package.json +++ b/samples/client/petstore/zapier/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "lodash": "^4.17.21", - "zapier-platform-core": "15.0.1", + "zapier-platform-core": "15.4.1", "form-data": "2.1.4" }, "devDependencies": { @@ -22,6 +22,6 @@ }, "private": true, "zapier": { - "convertedByCLIVersion": "14.1.1" + "convertedByCLIVersion": "15.4.1" } } \ No newline at end of file diff --git a/samples/client/petstore/zapier/utils/utils.js b/samples/client/petstore/zapier/utils/utils.js index a73f00e4778..201a15fb582 100644 --- a/samples/client/petstore/zapier/utils/utils.js +++ b/samples/client/petstore/zapier/utils/utils.js @@ -1,14 +1,14 @@ const _ = require('lodash') const replacePathParameters = (url) => url.replace(/{([^{}]+)}/g, (keyExpr, key) => `{{bundle.inputData.${key}}}`) -const childMapping = (objectsArray, prefix, model) => objectsArray.map(object => model.mapping({inputData: object}, prefix)) +const childMapping = (objectsArray, prefix, model) => objectsArray ? objectsArray.map(object => model.mapping({inputData: object}, prefix)) : undefined const removeIfEmpty = (obj) => _.isEmpty(JSON.parse(JSON.stringify(obj))) ? undefined : obj const buildKeyAndLabel = (prefix, isInput = true, isArrayChild = false) => { const keyPrefix = !_.isEmpty(prefix) && (!isArrayChild || isInput) ? `${prefix}${isInput ? '.' : '__'}` : prefix const labelPrefix = !_.isEmpty(keyPrefix) ? keyPrefix.replaceAll('__', '.') : '' return { keyPrefix: keyPrefix, - labelPrefix:labelPrefix, + labelPrefix: labelPrefix, } } const isSearchAction = (key) => {