Skip to content
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

[Warning] [Play] Explicitly set HTTP header Content-Type is not allowed #1360

Closed
gaeljw opened this issue Jul 5, 2021 · 0 comments · Fixed by #1375
Closed

[Warning] [Play] Explicitly set HTTP header Content-Type is not allowed #1360

gaeljw opened this issue Jul 5, 2021 · 0 comments · Fixed by #1375

Comments

@gaeljw
Copy link
Contributor

gaeljw commented Jul 5, 2021

Tapir version: 0.18.0-M11

Scala version: 2.13.6

Describe the bug

This doesn't seem to be causing any issue yet but I've noticed the following warning raised by Akka:

[warn] a.a.ActorSystemImpl - Explicitly set HTTP header 'Content-Type: application/json' is ignored, explicit `Content-Type` header is not allowed. Set `HttpResponse.entity.contentType` instead.

It could be nice to get rid of the warning.

How to reproduce?

I admit I didn't spend much to identify where the issue comes from, it may be because of the usage of Play-Json or maybe it's just Play Server interpreter in general.

A endpoint that reproduces the issue:

object MyTapir
    extends Tapir with PlayServerInterpreter with OpenAPIDocsInterpreter with TapirJsonPlay with SchemaDerivation with TapirAliases with StatusCodes with TapirOpenAPICirceYaml

import MyTapir._

val myEndpoint = endpoint
    .in("api" / "hello")
    .out(statusCode(Ok))
    .out(jsonBody[Seq[Long]])

Additional information

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant