Skip to content
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

feat: add skip null properties option to partial type #2863

Conversation

NovikovEvgeny
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

PartialType will return a class for which validations are ignored null properties (in addition to undefined properties).

Issue Number: 2843, 2623

What is the new behaviour?

PartialType can optionally return a class for which validations are ignored only for undefined properties, not null properties. This can be useful if you are creating a DTO for a PATCH endpoint: there may be a certain field, say name, that should not be null, but which doesn't need to be included in PATCH updates.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This is actually just a copy-paste of the same PR to mapped-types repo: nestjs/mapped-types#1274
Thanks to @tf3

Sorry, something went wrong.

@podplatnikm
Copy link

BUMP

@kamilmysliwiec kamilmysliwiec merged commit d3c8844 into nestjs:master Mar 29, 2024
1 check passed
@kamilmysliwiec
Copy link
Member

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants