#App not start if i enable swagger module

3 messages · Page 1 of 1 (latest)

fierce inlet
#

It not show all the logs on start about mapped routes and other. When I access an api route it return 404.

If i output the result, I see only some modules, 5 from 15, it stop and not go to other.

console.log(this.generateDenormalizedDocument(
      metatype as Type<unknown>,
      prototype,
      instance,
      documentResolvers,
      applicationConfig,
      options
))

If i change order of modules in app module i see other 5 module, and it stop on other module.
Without modules also not worked.

https://github.com/nestjs/swagger/blob/c1ece074491071fd3bfb23cd9534fcc9a3aa566e/lib/swagger-explorer.ts#L146

GitHub

OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas: - nestjs/swagger

fierce inlet
#

I found the cause, that code form

    // const document = SwaggerModule.createDocument(
    //   app,
    //   settings,
    //   // { autoTagControllers: false },
    // )

now is changed on nest docs site to:

const documentFactory = () => SwaggerModule.createDocument(app, settings)

Now I see error in console which previous was not shown like A circular dependency has been detected.

Huh.

solemn raft
#

sometimes you got those circular imports when using @ApiProperty decorators that has the type field