-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add @DtoCreateRequired decorator #55
Comments
Yes, similar to the |
(I'm waiting for some feedback on other features before releasing the next proper version.) |
Thank you for implementing this so quickly! I can confirm, that |
Currently, each annotation fulfills a different task: But if I think about it, you are probably right. similar to What I need to check is, if |
Sorry, it took some time to come back on this, but I now checked the behavior. For now, |
I need to generate a
CreateDTO
that contains a required field for theid
of an optional relation that can be set to null after the entry is created. This would typically happen viaonDelete: SetNull
.My use-case is a chat in which messages require a reference to a user/author on creation, but this reference can be null once the user is deleted, which in turn should not cause the message to be deleted.
In the model below this works well for
Channel
, which is a non-optional reference. ThechannelId
field on theCreateMessageDto
is required. But this is not the case forauthorId
.This is a simplified/partial version of my model:
The generated
CreateMessageDto
looks like this:I've tried different combinations of decorators, but cannot get it to work. Am I missing something?
Could a new decorator, for example
@DtoCreateRequired
help in this case?The text was updated successfully, but these errors were encountered: