Closed tomaszkane closed 1 year ago
Do you need two validator instances in the same request?
Hm, no its two requests.
First is api /validate to validate given data (all or part) - "validate what user send".
Second is /create - "validate all data needs to save record" so empty or missing values is not acceptable.
I see. So, an immutable method such as withDefaultSkipOnEmpty()
would do.
What steps will reproduce the problem?
Add DI definition:
What is the expected result?
I want to
Container::get(Validator::class)
and optionally changedefaultSkipOnEmpty
to validate different context.What do you get instead?
defaultSkipOnEmpty
cannot be changed, so I must add two definitions to DI, like:with is ugly.
Additional info