-
Notifications
You must be signed in to change notification settings - Fork 26
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
@DtoUpdateHidden has no effect #21
Comments
This Is this a feature you actually need? Basically a partial |
Yes, exactly, a partial At first I thought this would only be a nice-to-have but there's real value to this. If I could rely on the API validation to immediately throw an error if the transferred object contains fields that are not whitelisted, I can simply save any data that is successfully validated based on rules set in the schema file. Otherwise I would have to manually map the DTO to an object that only contains fields I know can be updated instead of simply relying on my schema. This adds a second validation layer, creating additional code that has to be maintained and could cause issues such as additional fields that are added later being stripped by mapping logic that wasn't updated for example. There should only be a single source of truth, in this case the schema file. |
With v1.18.0-beta1 release, I also added |
I've been testing this with v1.18.0-beta2 and it works like a charm, thanks! |
The README mentions the following annotation:
Using
@DtoUpdateHidden
in my own model has no effect on the UpdateDTO, which still shows the field as optional.I would expect the field to be omitted from the UpdateDTO while still being available in the CreateDTO and Entity.
Currently I can not rely on my API validation to remove this value on a request level using white listing rules.
The text was updated successfully, but these errors were encountered: