swaggerize-express icon indicating copy to clipboard operation
swaggerize-express copied to clipboard

How to add a global Middleware before all Paths

Open OmarSultan85 opened this issue 7 years ago • 2 comments

I'm looking for a way to add a global middleware before all handlers. I'm currently creating the handler as an array and making a call to my middleware through there but can't seem to find a way to default this middleware to all handlers.

Thanks and apologies if this is documented somewhere and I missed it.

OmarSultan85 avatar Jul 10 '17 05:07 OmarSultan85

I'm trying to do the same. My end goal is to support validating custom string formats, like "uuid".

ryanbecker avatar Aug 01 '17 18:08 ryanbecker

express-openapi supports this. See x-express-openapi-additional-middleware: https://github.com/kogosoftwarellc/express-openapi#configuring-middleware

jsdevel avatar Jan 17 '18 23:01 jsdevel