cdimascio / express-openapi-validator

🦋 Auto-validates api requests, responses, and securities using ExpressJS and an OpenAPI 3.x specification
MIT License
913 stars 208 forks source link

Add multipart fix when does not exist any body #905

Closed hiuxmaycry closed 7 months ago

hiuxmaycry commented 7 months ago

Context in our project we have endpoints in which there is no type of body parser involved, so req.body is always undefined for those requests. This happens because the body is not consumed on the server but is simply forwarded to another API (Our API is just a proxy to another API).

Therefore, we do not validate the content of the file in any way, we only check that the endpoint exists in the SPEC.

That said, we validate that the multipartNested function is only applied when the body exists so as not to generate an error of TypeError: Cannot convert undefined or null to object.

hiuxmaycry commented 7 months ago

Hi @cdimascio, can you please review this? 🙂

hiuxmaycry commented 6 months ago

Hi @cdimascio sorry for the inconvenience, do we have an ETA on when this fix will be released?

guillerecalde commented 6 months ago

Hey @cdimascio, any chance you have an ETA for when this fix will be released? Thanks!