-
Notifications
You must be signed in to change notification settings - Fork 137
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
Not able to crate post method with schema validation. #202
Comments
Missing code:
Also add example for post method zod with open api |
Same here. Could not create post requests. Didn't manage to make Swagger working but via Postman the create endpoint works. Here is a simple code for creating a user: userModel.ts
userRepository.ts
userService
userRouter
server.ts
|
@devdomsos
use,
|
I managed to get around this by adding the following lines of code server.ts httpHandlers.ts > validateRequest
and my schema format is
so that the client doesn't have to send a json with nested "body" property |
hi i am still getting this issue validation fail.
following is the error
|
i tried this but getting TypeError: req.body is not a function |
Structure for Post method with body should be something like this:
|
Thanks for this one. But validationRequest is the problem. Any suggestions on that? |
@609harsh you should probably pass
|
oh my bad. in actual codebase it is SignupSchema only. I was just trying some other things ended up pasting this one😅 |
Not able to crate post method.
Please provide one example of post, put method with schema validation.
The text was updated successfully, but these errors were encountered: