Open noerw opened 4 years ago
In every crud controller validation and serialization is on by default. setting up a global validator doe not effect because as one of the feature we use validation groups depending on a request type (post, patch/put) and thus can't use a nestjs global validation pipe. Serialization is on by default too.
So I have a question - why would you need to add those globally even if they are already being used internally by the lib?
I have other controllers that are not @Crud
annotated (as they are about custom logic).
I added those global pipes, as I wanted to have a common approach to validation & serialization, and was suprised that I didn't get that with @Crud
.
Your explanation with validation groups makes sense though, I'll look into it
See title; if i set these on my app (main.ts) like this, they have no effect on controllers annotated with
@Crud()
This is very unintuitive, is this intended?
As a workaround I set
CrudOptions.validation
on each@Crud()
controller, but this means duplication of config & is errorprone. Also; why is the validation property not available on theCrudGlobalConfig
(CrudConfigService.load({ validation })
)?