Skip to content

Commit

Permalink
Update generate-open-api-with-specific-endpoints-remove-additionalPro…
Browse files Browse the repository at this point in the history
…perties-if.ts
  • Loading branch information
p-zielinski committed Nov 28, 2023
1 parent 9f1d1fc commit 647f1fd
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const removeAdditionalProperties = (
return e;
};

const main = async () => {
const main = async (keepIfPropertiesNotPresent) => {
const openApiPath = path.join(__dirname, "../reference/OpenAPI.json");
const openAPIContent = JSON.parse(
(await fsPromises.readFile(openApiPath)).toString()
Expand Down Expand Up @@ -106,7 +106,8 @@ const main = async () => {
continue;
}
parameters[parameterName] = removeAdditionalProperties(
openAPIContent.components.parameters[parameterName]
openAPIContent.components.parameters[parameterName],
keepIfPropertiesNotPresent
);
}

Expand All @@ -123,7 +124,8 @@ const main = async () => {
continue;
}
schemas[schemaName] = removeAdditionalProperties(
openAPIContent.components.schemas[schemaName]
openAPIContent.components.schemas[schemaName],
keepIfPropertiesNotPresent
);
}

Expand Down Expand Up @@ -186,5 +188,5 @@ if (!always && !usedWithStandardProperties) {
)
);
} else {
main();
main(!!usedWithStandardProperties);
}

0 comments on commit 647f1fd

Please sign in to comment.