Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TypeScript request handler definition to generate route description #22

Open
hubgit opened this issue Mar 11, 2021 · 1 comment
Open

Comments

@hubgit
Copy link

hubgit commented Mar 11, 2021

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?

@hubgit hubgit changed the title Use query, Use TypeScript request handler definition to generate route description Mar 11, 2021
@wesleytodd
Copy link
Owner

Yes, I do think that is the right way to do this. Happy to accept a PR for this.

This was referenced Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants