You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the PromMethodCounter decorator on a controller function it will break the API documentation beginning from the line where the decorator was added.
Example
The following code generates API documentation for ApiOperation, ApiResponse and Data.
But it will not generate documentation for the query parameters.
@Get()
@ApiOperation({ title: 'Get something by query string' })
@ApiResponse({ status: 200, type: Data, description: 'List of Data objects' })
@PromMethodCounter()
public async getAllData(@Query() query: GetByQuery): Promise<Data[]> {
this.logger.info(`GET / by query`);
return await this.dataService.loadAllData().toPromise();
}
When I switch the order of decorators, only the basic documentation for the GET function is generated. Everything else is missing (also the model for Data)
@Get()
@PromMethodCounter()
@ApiOperation({ title: 'Get something by query string' })
@ApiResponse({ status: 200, type: Data, description: 'List of Data objects' })
public async getAllData(@Query() query: GetByQuery): Promise<Data[]> {
this.logger.info(`GET / by query`);
return await this.dataService.loadAllData().toPromise();
}
When I remove PromMethodCounter the API documentation is working as expected.
The text was updated successfully, but these errors were encountered:
When using the
PromMethodCounter
decorator on a controller function it will break the API documentation beginning from the line where the decorator was added.Example
The following code generates API documentation for
ApiOperation
,ApiResponse
andData
.But it will not generate documentation for the query parameters.
When I switch the order of decorators, only the basic documentation for the GET function is generated. Everything else is missing (also the model for
Data
)When I remove
PromMethodCounter
the API documentation is working as expected.The text was updated successfully, but these errors were encountered: