summary refs log tree commit diff
path: root/scripts/openapi.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/openapi.js')
-rw-r--r--scripts/openapi.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/openapi.js b/scripts/openapi.js
index 76025e4d..8258a76c 100644
--- a/scripts/openapi.js
+++ b/scripts/openapi.js
@@ -84,7 +84,7 @@ function combineSchemas(schemas) {
 	}
 
 	for (const key in definitions) {
-		const reg = new RegExp(/^[a-zA-Z0-9\.\-_]+$/, "gm");
+		const reg = new RegExp(/^[a-zA-Z0-9.\-_]+$/, "gm");
 		if (!reg.test(key)) {
 			console.error(`Invalid schema name: ${key} (${reg.test(key)})`);
 			continue;
@@ -218,9 +218,12 @@ function apiRoutes() {
 
 		obj.tags = [...(obj.tags || []), getTag(p)].unique();
 
-		specification.paths[path] = {
-			[method]: obj,
-		};
+		specification.paths[path] = Object.assign(
+			specification.paths[path] || {},
+			{
+				[method]: obj,
+			},
+		);
 	});
 }