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) {
|
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)) {
|
if (!reg.test(key)) {
|
||||||
console.error(`Invalid schema name: ${key} (${reg.test(key)})`);
|
console.error(`Invalid schema name: ${key} (${reg.test(key)})`);
|
||||||
continue;
|
continue;
|
||||||
@ -218,9 +218,12 @@ function apiRoutes() {
|
|||||||
|
|
||||||
obj.tags = [...(obj.tags || []), getTag(p)].unique();
|
obj.tags = [...(obj.tags || []), getTag(p)].unique();
|
||||||
|
|
||||||
specification.paths[path] = {
|
specification.paths[path] = Object.assign(
|
||||||
[method]: obj,
|
specification.paths[path] || {},
|
||||||
};
|
{
|
||||||
|
[method]: obj,
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user