Skip to content

Commit

Permalink
fix component.json builder
Browse files Browse the repository at this point in the history
  • Loading branch information
shulkaolka committed Mar 25, 2024
1 parent bb7c2ab commit eb9d2f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/utils/schemaAndComponentJsonBuilder.js
@@ -1,6 +1,6 @@
const _ = require("lodash");
const { getSchemaOut } = require("./recursiveSearch");
const { filename, toText, quote, output } = require("./functions");
const { filename, toText, output } = require("./functions");
const { lookup } = require("../scripts");
const mediaTypeParser = require("media-type");

Expand Down Expand Up @@ -110,8 +110,9 @@ async function schemaBuilder(api, componentJson, existingNames, outputDir) {
// get requests with path params are also triggers
// we need to add a postfix to the trigger name, so that we don't break old components
if (method === "get" && opPath.includes("{")) {
action.main = filename("lib/triggers/trigger.js");
componentJson.triggers[`${name}_trigger`] = action;
const trigger = _.cloneDeep(action);
trigger.main = filename("lib/triggers/trigger.js");
componentJson.triggers[`${name}_trigger`] = trigger;
}
});
});
Expand Down

0 comments on commit eb9d2f5

Please sign in to comment.