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
I am currently using jjv for parsing user-provided JSON from a web form. However, one of the fields I can get is a foreign key to a resource, and I need to valide it then coerce it into a complete JSON object (the entry in a database related to said foreign key).
Is there a way for me to include this check and coercion in jjv?
If jjv does not allow this, is it a planned feature? One way to do it would be to check and apply asynchronous logic if 1 < Function.length, both for validation and coercion.
As an example, my use case is this:
I have a user-provided JSON in this form:
What I need to validate is that idToForeign is an integer, has a related entry in the database that I will fetch a second later and has permission to reference it. Permission may not be validable with jjv, as jjv does not (and, in my understanding, does not mean to) allow validation of fields in relation with each other, but I still would like to check and fetch said entry during the jjv validation / coercion, before processing this input.
Thanks a bunch in advance!
Regards,
The text was updated successfully, but these errors were encountered:
Hi,
I am currently using
jjv
for parsing user-provided JSON from a web form. However, one of the fields I can get is a foreign key to a resource, and I need to valide it then coerce it into a complete JSON object (the entry in a database related to said foreign key).Is there a way for me to include this check and coercion in
jjv
?If
jjv
does not allow this, is it a planned feature? One way to do it would be to check and apply asynchronous logic if1 < Function.length
, both for validation and coercion.As an example, my use case is this:
I have a user-provided JSON in this form:
What I need to validate is that
idToForeign
is an integer, has a related entry in the database that I will fetch a second later and has permission to reference it. Permission may not be validable withjjv
, asjjv
does not (and, in my understanding, does not mean to) allow validation of fields in relation with each other, but I still would like to check and fetch said entry during thejjv
validation / coercion, before processing this input.Thanks a bunch in advance!
Regards,
The text was updated successfully, but these errors were encountered: