Closed nicobuzeta closed 4 months ago
Good catch! I knew about this limitation but I hadn't figured out how to solve it before.
It's not really advisable to wrap entire controller methods in a transaction, so I didn't pay it much attention.
Thank you so much for the investigation and the PR, if it doesn't break anything, I'll merge it as soon as I can.
Fix released in @nestjs-cls/transactional@2.3.1
Hi, I'm having a problem with the @Transactional decorator. When I add it to a controller method, the corresponding post on the swagger documentation loses its corresponding openapi.ApiResponse. I've looked at the compiled JS code and both decorators are being added correctly, so I'm not entirely sure where the problem could be coming from, but I'm not well versed in NestJS decorators. Do you have any idea what might be causing it?
For example: These two endpoints:
The first two have the post schema on swagger, while the last doesn't. However, the compiled JS:
Has the correct decorators from what I can see. What could the cause of the problem?
Edit: On further inspection I found this issue on the swagger repo. I think this might be what's wrong with @Transactional as it also overwrites the property.