Closed jeasonstudio closed 6 years ago
A couple of things:
- can you remove the generated dist files from the PR
- add a unit test to cover the formData change
Done for these.
Waiting for the new version. Thx.
just published new versions of swagger2 and swagger2-koa
Hi, i got {"code":"SWAGGER_REQUEST_VALIDATION_FAILED","errors":[{"expected":{"type":"string"},"error":"data is the wrong type","where":"formData"},{"expected":{"type":"string"},"error":"data is the wrong type","where":"formData"}]}
Please patch it like this:
case 'formData':
- value = (body || {})[parameter.name];
+ value = (body.fields || {})[parameter.name];
The reason is that the body object consist of two other objects fields:Object {id: 0, note: "blabla", …} files:Object {}
and has no parameter.name key
@alexbe can you submit a PR for this that includes a test case.
Coverage remained the same at 100.0% when pulling 1bb2121e20ebaad098a783ee3eed3acd2ec6e876 on jeasonstudio:master into c83a25935dfd27602cbc83f4d1dab43ab7a2f3ad on carlansley:master.