swagger-express-middleware icon indicating copy to clipboard operation
swagger-express-middleware copied to clipboard

Validate response body based in swagger schemas

Open fantun3s opened this issue 8 years ago • 5 comments
trafficstars

I think that would be very helpful if swagger-express-middleware, besides Validate Request middleware feature, also had a feature to validate responses.

fantun3s avatar Aug 07 '17 10:08 fantun3s

I think this is the main thing preventing me from using this library. swagger-tools, by default, has support for response validation.

robertmassaioli avatar Sep 07 '17 13:09 robertmassaioli

That would go beyond the scope of middleware, though, as I believe you can't have pre-response middleware in Express, so you'd have to call that validation explicitly.

igor-savin-ht avatar Apr 09 '18 10:04 igor-savin-ht

Bump, indeed, it's strange that this is not implemented. It's very important as well for us. Why this wasn't implemented?

Somebi avatar May 02 '19 10:05 Somebi

There is official swagger node module, which does exactly that, but we choose this module, because it's updated more often. Maybe you can look how that is implemented in their module?

Somebi avatar May 02 '19 10:05 Somebi

https://github.com/swagger-api/swagger-node

Somebi avatar May 02 '19 10:05 Somebi