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
Hi, I am currently using swaggerize-express/-routes in a client project and find it to be really useful.
However, I have noticed that the property path is set incorrectly for nested objects on input validation. I.e. I have a swagger.json which contains sth. like the following (following the JSON API spec):
So any input JSON object is required to have data.type (string) and data.attributes (object).
When a validation for a nested property fails though, the "path" provided in the error details contains only the property name, not the full path – i.e. type instead of data.type or email instead of data.attributes.email.
This is the source line that looks like the chief culprit:
Hi, I am currently using swaggerize-express/-routes in a client project and find it to be really useful.
However, I have noticed that the property path is set incorrectly for nested objects on input validation. I.e. I have a swagger.json which contains sth. like the following (following the JSON API spec):
So any input JSON object is required to have
data.type (string)
anddata.attributes (object)
.When a validation for a nested property fails though, the
"path"
provided in the errordetails
contains only the property name, not the full path – i.e.type
instead ofdata.type
oremail
instead ofdata.attributes.email
.This is the source line that looks like the chief culprit:
swaggerize-routes/lib/validator.js
Line 117 in 910c390
Is there a particular reason for replacing the original
detail.path
with theparameter.name
?Cheers and thanks a lot!
The text was updated successfully, but these errors were encountered: