cdimascio / express-openapi-validator

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

Normalize request body ContentTypes #863

Closed rayvincent2 closed 11 months ago

rayvincent2 commented 1 year ago

Fixes #862

First I tackled ensuring that any ContentType type could be normalized so we could perform easy comparisons between what an HTTP request may send vs what the openapi document is expecting. By normalizing as well, I was able to easily ensure that cache keys for validators don't have any conflicts.

Tests have been added to showcase the working solution.

rayvincent2 commented 1 year ago

Has anybody had a chance to review this?

cdimascio commented 11 months ago

Has anybody had a chance to review this?

Getting to this now. Looks good. Thank you! One minor review nit

rayvincent2 commented 11 months ago

Has anybody had a chance to review this?

Getting to this now. Looks good. Thank you! One minor review nit

Thanks for the review! I went ahead and made the update, rebased, and squashed. It's ready for another look.