This commit is contained in:
The Arcane Brony committed 2021-10-01 22:44:58 +02:00
commit 20920071a9
2 files changed
+154 -460

No files matched your search

+142 -459
View File
File diff suppressed because it is too large. Load diff
+12 -1
View File
@@ -30,6 +30,15 @@ const Excluded = [
"supertest.Response"
];
function modify(obj) {
delete obj.additionalProperties;
for (var k in obj) {
if (typeof obj[k] === "object" && obj[k] !== null) {
modify(obj[k]);
}
}
}
function main() {
const program = TJS.getProgramFromFiles(walk(path.join(__dirname, "..", "src", "routes")), compilerOptions);
const generator = TJS.buildGenerator(program, settings);
@@ -47,7 +56,9 @@ function main() {
definitions = { ...definitions, [name]: { ...part } };
}
fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4));
modify(definitions);
fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4).replace(/ "additionalProperties": ?false,?/g, ""));
}
main();