Closed FelipeQueFez closed 3 months ago
It's strange that AutoSwagger is looking for a members_controller.js.ts
(.js.ts) extension.
I just published a new version 3.6.0, could you try it with that and set debug: true
if it still produces the same error.
@ad-on-is thank you so much for the answer.
I use Windows and in my routes.ts
my import stay that:
const MembersController = () => import('../app/controllers/members_controller.js')
When i change for this, so worked.
const MembersController = () => import('../app/controllers/members_controller')
Now another question, i have this controller:
@inject()
export default class MembersController {
constructor(protected loginService: LoginService) {}
/**
* @description Returns array of producs and it's relations
* @responseBody 200 - <Product[]>.with(relations)
* @paramUse(sortable, filterable)
* @responseHeader 200 - @use(paginated)
* @responseHeader 200 - X-pages - A description of the header - @example(test)
*/
async login(ctx: HttpContext): Promise<String> {
var result = await this.loginService.login(ctx.request.body() as RequestLoginDTO)
return result
}
}
I put the block of comments on the method login
. But the texts not showing in my swagger UI, i forgotten something?
Your notation is wrong, there's no responseHeader, but responseBody. Edit: Sorry for this one. Seems like I forgot I had implemented responseHeader back than.
Also, paramUse with sortable and filterable is for the manual configs and has no effect in your case (based on your swagger.config), and I assume you just copy&pasted it.
please read the docs thoroughly, and report back if you find any issues.
I am using this package at 3.4.1 with Adonis 6.2.2 and node 20.11.1
But have the following error:
Package.json
swagger.ts
Any feedback would be appreciated. Thanks.