express-openapi
express-openapi copied to clipboard
Use TypeScript request handler definition to generate route description
The generic TypeScript description for express.RequestHandler allows type definitions for the request path params, response body, request body and request query params:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/03fa4ecc7ecbe94e50b5e5fe03d7add64a198198/types/express-serve-static-core/index.d.ts#L53-L66
Would it be possible to make use of these when generating the OpenAPI description for a route?
Yes, I do think that is the right way to do this. Happy to accept a PR for this.