-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - Fix Nested Validation #4306
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djabarovgeorge thanks for doing this!! Left a couple of comments
uuid?: string; | ||
|
||
@IsOptional() | ||
@IsBoolean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IsBoolean() | |
@IsString() |
@ValidateNested({ each: true }) | ||
@Type(() => NotificationStep) | ||
steps: NotificationStep[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be added in update-notification-template.command as well
This PR is being closed due to inactivity. Please reopen if work is intended to be continued. |
What change does this PR introduce?
The PR introduces WIP of what we need to do in order to fix the nested validation that currently is broken. In order to add nested validation to the variants we will need to do the following:
@ValidateNested({ each: true })
), then add@Type(() => NotificationStepVariant)
decorator fromclass-transformer
in order to map the type implicitly.constrains
.Why was this change needed?
So we could validate nested objects and return a valid error if validations had errors.
Other information
In this PR I am adding nested validation only for variants as POC, once we merge this PR we most definitely need to validate all of the rest
ValidateNested
decorators.DOD