You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the users posts a new recipe, we don't want or expect them to pass the creationDate or the author, because those will be added by the system.
How will will be able to tell the route-level validator which of the user-supplied fields we do or (preferably) don't want to validate?
Could we perhaps extend the Recipe interface, delete a few fields, and pass that to the validator?
Additional: There are also sometimes cases where the user will send more fields than are in the collection.
(For example, during signup, they often provide a 'password' field, but our controller removes that before saving the document, preferring to hash it and store it in a separate collection.)
So in general, this issue is about modifying the interface, with addition or removal, before using it for validation.
EDIT: Thanks shimks, 1179 does indeed cover this use case. No need for me to keep this open.
The text was updated successfully, but these errors were encountered:
Hi @joeytwiddle, I believe the feature request you're proposing is tracked by #1179. Please take a look at the issue and let us know if it covers what you'd like to see with partial model validation :)
I wanted to make a comment on #118 but it's probably neater to make a separate issue.
There is a use case which we use quite often. That is:
In this case, we would like to validate the user's input against a partial interface of the model, not the complete model interface.
Example:
We have a database of recipes that look like:
When the users posts a new recipe, we don't want or expect them to pass the
creationDate
or theauthor
, because those will be added by the system.How will will be able to tell the route-level validator which of the user-supplied fields we do or (preferably) don't want to validate?
Could we perhaps extend the Recipe interface, delete a few fields, and pass that to the validator?
Additional: There are also sometimes cases where the user will send more fields than are in the collection.
(For example, during signup, they often provide a 'password' field, but our controller removes that before saving the document, preferring to hash it and store it in a separate collection.)
So in general, this issue is about modifying the interface, with addition or removal, before using it for validation.
EDIT: Thanks shimks, 1179 does indeed cover this use case. No need for me to keep this open.
The text was updated successfully, but these errors were encountered: