-
Notifications
You must be signed in to change notification settings - Fork 412
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
Optional content codec failing on missing request body #3144
Labels
Comments
/bounty $150 for fix and testcase proving it's fixed. |
💎 $150 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-http! Add a bounty • Share on socials
|
💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
987Nabil
added a commit
to 987Nabil/zio-http
that referenced
this issue
Sep 27, 2024
987Nabil
added a commit
that referenced
this issue
Sep 27, 2024
🎉🎈 @987Nabil has been awarded $150! 🎈🎊 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I'd like to define an endpoint where the request body is optional. I've passed an optional content codec to the endpoint, but the implemented route is still returning an error indicating not being able to read the body there is no body in the request:
To Reproduce
Steps to reproduce the behaviour:
I've defined an extension method as
created and endpoint using that:
and implemented the route:
Make a request with no body to that endpoint results in the error. Passing a correctly formed body does not result in the error.
Expected behaviour
Specifying an optional
in
declaration should allow requests with no body and result in anOption
being added to the expectedIn
type and empty option being passed to the handler function if the request contains no body.Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: