Open yann510 opened 2 years ago
I'm trying to override the default generated operationIds using the SwaggerDocumentOptions:
operationIds
SwaggerDocumentOptions
const swaggerConfig = new DocumentBuilder().setTitle("Stator").setDescription("The stator API description").setVersion("1.0").build() const swaggerOptions: SwaggerDocumentOptions = { operationIdFactory: (controllerKey, methodKey) => { const entityName = `${methodKey.includes("Many") ? "" : "s"}Controller` return methodKey.includes("Base") ? `${methodKey.replace("Base", controllerKey.replace(entityName, ""))}` : `${methodKey}${entityName}` }, } const document = SwaggerModule.createDocument(app, swaggerConfig, swaggerOptions)
It works for all my controllers which are not using the @nestjsx/crud to generate the endpoints.
@nestjsx/crud
I'm trying to override the default generated
operationIds
using theSwaggerDocumentOptions
:It works for all my controllers which are not using the
@nestjsx/crud
to generate the endpoints.