We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When the outError type is Unit the response should be empty.
outError
Unit
To Reproduce
val ep = Endpoint(RoutePattern.GET / "greeting" / PathCodec.string("name") / "exclamation" / PathCodec.string("bool")) .outCodec(HttpCodec.content[Greeting](MediaType.text.plain)) .outError[Unit](Status.NotFound) .implement(greetingHandler)
generates response:
curl -v http://localhost:8080/greeting/Jane/exclamation/o * Host localhost:8080 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:8080... * Connected to localhost (::1) port 8080 > GET /greeting/Jane/exclamation/o HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 404 Not Found < content-type: application/json < date: Mon, 16 Dec 2024 15:04:26 GMT < content-length: 2 < * Connection #0 to host localhost left intact {}
Expected behaviour Send back empty response (no content-type??) and no data
curl -v http://localhost:8080/greeting/Jane/exclamation/o * Host localhost:8080 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:8080... * Connected to localhost (::1) port 8080 > GET /greeting/Jane/exclamation/o HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 404 Not Found < date: Mon, 16 Dec 2024 15:04:26 GMT < content-length: 2 < * Connection #0 to host localhost left intact
Dependencies
"dev.zio" %% "zio" % "2.1.9", "dev.zio" %% "zio-http" % "3.0.1" "dev.zio" %% "zio-schema" % "1.4.1"
The text was updated successfully, but these errors were encountered:
Tested with text/plain response content type:
text/plain
val ep3 = Endpoint(RoutePattern.GET / "greeting" / PathCodec.string("name") / "exclamation" / PathCodec.string("bool")) .outCodec(HttpCodec.content[Greeting](MediaType.text.plain)) .copy(error = HttpCodec.content[Unit](MediaType.text.plain) ++ HttpCodec.status(Status.NotFound)) .implement(greetingHandler)
and behaviour is stilll strange:
curl -v http://localhost:8080/greeting/Jane/exclamation/n * Host localhost:8080 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:8080... * Connected to localhost (::1) port 8080 > GET /greeting/Jane/exclamation/n HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 404 Not Found < content-type: text/plain < date: Tue, 17 Dec 2024 10:22:35 GMT < content-length: 2 < * Connection #0 to host localhost left intact ()
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When the
outError
type isUnit
the response should be empty.To Reproduce
generates response:
Expected behaviour
Send back empty response (no content-type??) and no data
Dependencies
The text was updated successfully, but these errors were encountered: