express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

encoding, contentType: image/jpeg not validated

Open tamis-laan opened this issue 3 years ago • 2 comments

I have a request with the following body:

     requestBody:
       content:
         multipart/form-data:
           schema:
             type: object
             properties:
               avatar:
                 type: string
                 format: binary
           encoding:
             avatar:
               contentType: image/jpeg

However I can just upload a image/png and express-openapi-valdator doesn't care :-/

tamis-laan avatar Jan 07 '22 21:01 tamis-laan

same is for mp4, there is a part missing @tamis-laan how did you manage to?

sghoe avatar Feb 07 '22 06:02 sghoe

@sghoe Nope, I postponed this for other work. Planning to fix this by manually checking the media type for now. I remember there is a package called mime for nodejs that you can use: https://www.npmjs.com/package/mime But ugly solution...

tamis-laan avatar Feb 07 '22 09:02 tamis-laan