open-template-hub / swagger-decorators Goto Github PK
View Code? Open in Web Editor NEWOTH library that contains methods and decorators to ease and automate Swagger documentation.
License: MIT License
OTH library that contains methods and decorators to ease and automate Swagger documentation.
License: MIT License
I tried to build your example, but I got an issue reading the generated swagger file.
The generate tag/index.swagger.tag.ts
is spreading the tags as an object
while it's actually an array
import { MyRouteTags } from "./myroute.swagger.tag";
export const allTags = {
...MyRouteTags,
};
If I manually change the content of this file to
import { MyRouteTags } from "./myroute.swagger.tag";
export const allTags = [
...MyRouteTags,
];
Then I can serve the swagger file with swagger-ui-express
as shown in your example.
But otherwise I get an error message
/docs/swagger/index.swagger.ts:42
tags: [...allTags],
^
TypeError: index_swagger_tag_1.allTags is not iterable
at new SwaggerSpec (/home/moinax/WebstormProjects/mbrella/public-client/docs/swagger/index.swagger.ts:42:15)
at Object.<anonymous> (/home/moinax/WebstormProjects/mbrella/public-client/src/docs/serve.ts:4:30)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module.m._compile (/home/moinax/WebstormProjects/mbrella/public-client/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Object.require.extensions.<computed> [as .ts] (/home/moinax/WebstormProjects/mbrella/public-client/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at phase4 (/home/moinax/WebstormProjects/mbrella/public-client/node_modules/ts-node/src/bin.ts:649:14)
I believe the issue comes from the fact that you use the same index.template for all of them, which works perfectly fine except for the tags, because they are not an object like the others, but an array.
Open Template Hub © 2023 |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.