Closed muhammadharis1212 closed 10 months ago
Hello there muhammadharis1212 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Swagger json outputs file which has empty fields so the documentation remains empty. Decorators are not working.
tsoa.json file:
{ "controllerPathGlobs": ["./src/controllers/**/*.controller.ts"], "modelPathGlobs": ["./src/models/**/*.model.ts"], "routes": { "routesDir": "./src/routes" }, "entryFile": "src/server.ts", "noImplicitAdditionalProperties": "throw-on-extras", "spec": { "outputDirectory": "public", "specVersion": 3 } }
Controller file:
@Route('users') export class UserController { public user = Container.get(UserService); @Get('/') public getUsers = async (req: Request, res: Response, next: NextFunction) => { try { const findAllUsersData: User[] = await this.user.findAllUser(); res.status(200).json({ data: findAllUsersData, message: 'success' }); } catch (error) { next(error); } }; }
swagger.json file:
{ "components": { "examples": {}, "headers": {}, "parameters": {}, "requestBodies": {}, "responses": {}, "schemas": {}, "securitySchemes": {} }, "info": { "title": "erp-server", "version": "1.0.0", "description": "TypeScript + Mongoose + MongoDB + Express API Server", "license": { "name": "ISC" }, "contact": {} }, "openapi": "3.0.0", "paths": {}, "servers": [ { "url": "/" } ] }