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
@types/express request's body object to T (generic) #16958
Comments
Agreed, this should be changed for peoples that want to type their Request body, same should apply to |
I don't hate this idea, but at the same time there is this issue from types/express which explains that Unfortunately the DefinitelyTyped version of body-parser doesn't work with the workaround they proposed. So either body needs to be added here, or DefinitelyTyped/body-parser needs to be updated. |
Make sense, also I think there is a way to include this feature without breaking changes by using default generics, ex: interfare Request<B = any, Q = any, P = any, C = any> {
body: B;
query: Q;
params: P;
cookies: C;
} |
hey there!
why not change the body of the Request to T? that way I can be sure what my object contains.
in express-serve-static-core/index.d.ts line 438:
and I use it like this:
The text was updated successfully, but these errors were encountered: