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 Zio-http does not send the correct Content-Type response header. When client send the Accept header to plain/text.
To Reproduce Steps to reproduce the behaviour:
val mediaTypeJsonOrTextEndpoint = Endpoint(RoutePattern.POST / "api" / "mediaTypeJsonOrText") .outCodec(HttpCodec.content[Greeting](MediaType.text.plain)) .outCodec(HttpCodec.content[Greeting](MediaType.application.json)) routes = routes :+ mediaTypeJsonOrTextEndpoint.implement { case (name) => { ZIO.succeed(new Greeting(name="greeting")) } } endpoints = endpoints :+ mediaTypeJsonOrTextEndpoint var openAPI = OpenAPIGen.fromEndpoints(title = "Server OpenAPI", version = "1.0", bookEndpoint, endpoints: _*) val swaggerRoutes = SwaggerUI.routes("openapi", openAPI) for(server <- openAPI.servers) { println(f"server=${server}") } routes = routes ++ swaggerRoutes.sandbox val app = routes.sandbox val run = Server.serve(app).provide(Server.default, Client.default).exitCode
Expected behaviour Changing the Accept header must cause the client to send Content-Type: plain/text as response and the body as this type
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Zio-http does not send the correct Content-Type response header. When client send the Accept header to plain/text.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Changing the Accept header must cause the client to send Content-Type: plain/text as response and the body as this type
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: