carlansley / swagger2-koa

Koa 2 middleware for swagger2
MIT License
99 stars 28 forks source link

Validating header in validate.ts #15

Closed andy-yeung-cx closed 6 years ago

andy-yeung-cx commented 7 years ago

Hi just wonder in validate.ts.
const validationErrors = swagger.validateRequest(compiledPath, context.method, context.request.query, context.request.body)

Could the library add context.request.header at the end? Now it complains the request schema not match if I mark a header parameter as compulsory.

carlansley commented 7 years ago

Yes for sure. Not something I've needed yet but happy to accept a PR on this, especially if you can add a test for it.

brad-jones commented 6 years ago

FYI: I sneaked this into my PR here: https://github.com/carlansley/swagger2-koa/pull/17