mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-22 02:12:40 +01:00
Fix bug where different HTTP method handlers would overwrite eachother in spec generation
This commit is contained in:
parent
a8a28542f7
commit
029bc8b5f8
2630
assets/openapi.json
2630
assets/openapi.json
File diff suppressed because it is too large
Load Diff
@ -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,
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user