diff --git a/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/EndpointGenerator.scala b/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/EndpointGenerator.scala index 2e66241867..400ac50df6 100644 --- a/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/EndpointGenerator.scala +++ b/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/EndpointGenerator.scala @@ -382,7 +382,7 @@ class EndpointGenerator { case StreamingImplementation.Pekko => "sttp.capabilities.pekko.PekkoStreams" case StreamingImplementation.Zio => "sttp.capabilities.zio.ZioStreams" } - s"streamTextBody($capability)(CodecFormat.TextPlain())" + s"streamTextBody($capability)(CodecFormat.OctetStream())" case x => bail(s"$contentType only supports binary schema. Found $x") } diff --git a/openapi-codegen/sbt-plugin/src/sbt-test/sbt-openapi-codegen/oneOf-json-roundtrip/Expected.scala.txt b/openapi-codegen/sbt-plugin/src/sbt-test/sbt-openapi-codegen/oneOf-json-roundtrip/Expected.scala.txt index 1ed8446f74..454c390615 100644 --- a/openapi-codegen/sbt-plugin/src/sbt-test/sbt-openapi-codegen/oneOf-json-roundtrip/Expected.scala.txt +++ b/openapi-codegen/sbt-plugin/src/sbt-test/sbt-openapi-codegen/oneOf-json-roundtrip/Expected.scala.txt @@ -123,13 +123,13 @@ object TapirGeneratedEndpoints { endpoint .get .in(("binary" / "test")) - .out(streamTextBody(sttp.capabilities.pekko.PekkoStreams)(CodecFormat.TextPlain()).description("Response CSV body")) + .out(streamTextBody(sttp.capabilities.pekko.PekkoStreams)(CodecFormat.OctetStream()).description("Response CSV body")) lazy val postBinaryTest = endpoint .post .in(("binary" / "test")) - .in(streamTextBody(sttp.capabilities.pekko.PekkoStreams)(CodecFormat.TextPlain())) + .in(streamTextBody(sttp.capabilities.pekko.PekkoStreams)(CodecFormat.OctetStream())) .out(jsonBody[String].description("successful operation")) lazy val putAdtTest =