-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Partial schema validation #394
Comments
So common practice is to use DTO, we can handle such a functionality using Projection. I am not sure, that it is a good idea, to keep delta objects validated with schema. I suggest to use Projection as a DTO for validating update deltas or same cases. |
@lundibundi I see two solutions here. 1st - use projection. 2nd - make additional method, which checks only given fields if it is in schema |
Additional method would be better because IMO projection is for more "stable" things and creating one each time we want to vaildate some fields would be wasteful. |
To-Do
({
Entity: {},
login: { type: 'string', length: { min: 8, max: 64 }, unique: true },
password: { type: 'string', note: 'Password hash' },
roles: { many: 'Role' },
}); Object that contains at least 1 field from schema must be partially validated |
|
I can take this issue |
@Bespaliy then take it please |
Is your feature request related to a problem? Please describe.
Sometimes it is necessary to support
update
-like methods and currently it is not possible to performSchema#check
on partial objects.Describe the solution you'd like
It would be good to have an ability to
check
patches\updates using general Schema. Via separate method or custom options tocheck
that would disablerequired
checks and some other while still having an ability to check fields.The text was updated successfully, but these errors were encountered: