https://docs.nestjs.com/pipes
Solution: According to the docs pipes are annotated with @Injectable and implement a transform method. So we can use that to hook into the framework. There are built-in pipes provided by nest and users can also implement custom pipes. This approach should work for both.
Limitation: Although the nest docs say that pipes should always have an @Injectable decorator, pipes work just fine without it unless it has dependencies on other services.
https://docs.nestjs.com/pipes
Solution: According to the docs pipes are annotated with
@Injectableand implement a transform method. So we can use that to hook into the framework. There are built-in pipes provided by nest and users can also implement custom pipes. This approach should work for both.Limitation: Although the nest docs say that pipes should always have an @Injectable decorator, pipes work just fine without it unless it has dependencies on other services.