diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/openapi.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/openapi.js b/scripts/openapi.js index ff648a70..0b21f1a3 100644 --- a/scripts/openapi.js +++ b/scripts/openapi.js @@ -202,6 +202,19 @@ function apiRoutes() { })); } + if (route.query) { + // map to array + const query = Object.entries(route.query).map(([k, v]) => ({ + name: k, + in: "query", + required: v.required, + schema: { type: v.type }, + description: v.description, + })); + + obj.parameters = [...(obj.parameters || []), ...query]; + } + obj.tags = [...(obj.tags || []), getTag(p)].unique(); specification.paths[path] = { |