summary refs log tree commit diff
path: root/scripts/openapi.js
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-03-24 04:16:58 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-03-24 04:16:58 +1100
commit0f928e479cbd81b17710da5dad14a092f23cdf0d (patch)
treed885d84ba47d601c4ba064e1cf47d1369198c617 /scripts/openapi.js
parentMerge branch 'master' of github.com:fosscord/fosscord-server (diff)
downloadserver-0f928e479cbd81b17710da5dad14a092f23cdf0d.tar.xz
Work towards fixing openapi spec
Diffstat (limited to 'scripts/openapi.js')
-rw-r--r--scripts/openapi.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/openapi.js b/scripts/openapi.js
index f280eba4..86297967 100644
--- a/scripts/openapi.js
+++ b/scripts/openapi.js
@@ -85,13 +85,15 @@ function apiRoutes() {
 		.map((x) => ({ name: x }));
 
 	specification.components = specification.components || {};
-	specification.components.securitySchemes = {
-		bearer: {
-			type: "http",
-			scheme: "bearer",
-			description: "Bearer/Bot prefixes are not required.",
+	specification.components.securitySchemes = [
+		{
+			bearer: {
+				type: "http",
+				scheme: "bearer",
+				description: "Bearer/Bot prefixes are not required.",
+			},
 		},
-	};
+	];
 
 	routes.forEach((route, pathAndMethod) => {
 		const [p, method] = pathAndMethod.split("|");
@@ -109,7 +111,7 @@ function apiRoutes() {
 				return x.test(path);
 			})
 		) {
-			obj.security = [{ bearer: true }];
+			obj.security = [{ bearer: [] }];
 		}
 
 		if (route.body) {