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
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
I'm using nestjs-config in the current project. It provides method and parameter decorators for own config service (readme). It's @Configurable() decorator replaces method's descriptor.value with own function (source) and seems like this decorator breaks nestjs route decorator when it is located before these decorators. But all works fine when it is placed on the last place.
Broken example:
@Controller('cats')exportclassCatsController{constructor(){}
@Configurable()// <-- custom decorator at the top of order.
@Get('view')// <-- nestjs decorator won't work
@UseInterceptors(ImageInterceptor)// <-- nestjs decorator won't workpublicasyncgetMostLikedPosts(@ConfigParam('cats.limit') @Query('page')page: number): Cat[]{// ... some implementation.}}
Broken example 2:
@Controller('cats')exportclassCatsController{constructor(){}
@Get('view')// <-- nestjs decorator will work fine
@Configurable()// <-- custom decorator in the middle of order.
@UseInterceptors(ImageInterceptor)// <-- nestjs decorator won't workpublicasyncgetMostLikedPosts(@ConfigParam('cats.limit') @Query('page')page: number): Cat[]{// ... some implementation.}}
Working example:
@Controller('cats')exportclassCatsController{constructor(){}
@Get('view')// <-- nestjs decorator will work fine
@UseInterceptors(ImageInterceptor)// <-- nestjs decorator will work fine
@Configurable()// <-- custom decorator at the bottom of orderpublicasyncgetMostLikedPosts(@ConfigParam('cats.sort')sort: string, @Query('page')page: number, @Query('limit')limit: number): Promise<Post[]>{// ... some implementation.}}
Expected behavior
Custom decorators do not break break nestjs or described behavior is well documented.
Environment
Nest version: 5.3.11
For Tooling issues:
- Node version: 8.11.3 and 10
- Platform: Linux, Ubuntu 16.04
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
I'm using nestjs-config in the current project. It provides method and parameter decorators for own config service (readme). It's
@Configurable()
decorator replaces method'sdescriptor.value
with own function (source) and seems like this decorator breaks nestjs route decorator when it is located before these decorators. But all works fine when it is placed on the last place.Broken example:
Broken example 2:
Working example:
Expected behavior
Custom decorators do not break break nestjs or described behavior is well documented.
Environment
The text was updated successfully, but these errors were encountered: