Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorators not working. swagger json contains empty fields #1491

Closed
muhammadharis1212 opened this issue Oct 5, 2023 · 2 comments
Closed
Labels

Comments

@muhammadharis1212
Copy link

muhammadharis1212 commented Oct 5, 2023

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": "/" } ] }

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

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.👀

Copy link

github-actions bot commented Nov 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant