-
Notifications
You must be signed in to change notification settings - Fork 109
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
Problem with loadServices and swagger #100
Comments
Hi @alfonsoal1983 , Swagger generator parses the typescript file and find all classes decorated with any typescript-rest decorator to generate the docs. This parser receives an entrypoint file and follow any imports it find to search into other files too. When you are using But is possible to inform to SwaggerGen the entrypoint for the parser. You can configure it in the swagger-config.json: {
"swagger": {
"yaml": false,
"outputDirectory": "./dist",
"entryFile": "./src/services/myService.ts",
}
} I changed the parser to accept also one array of entryFiles: {
"swagger": {
"yaml": false,
"outputDirectory": "./dist",
"entryFile": ["./src/services/myService.ts","./src/services/myService2.ts"]
}
} and also glob expressions: {
"swagger": {
"yaml": false,
"outputDirectory": "./dist",
"entryFile": "./src/services/*.ts"
}
} But is not published yet to npm. I am preparing a new major version that will include some other features, like support for open api 3.0 |
Done. Please update typescript-rest-swagger to version 1.0.3 |
Doing tests with the import of the services, I just realized that the swaggerGen works well with the function buildServices (passing directly to the services) but when using the function loadServices (passing the route correctly) it does not create the routes in the swagger, the routes work well but the swagger does not generate it well. Do you know why it can be @thiagobustamante ?
The swagger only shows the text:
No operations defined in spec!
The text was updated successfully, but these errors were encountered: