diff --git a/zio-http-cli/src/main/scala/zio/http/endpoint/cli/CliEndpoint.scala b/zio-http-cli/src/main/scala/zio/http/endpoint/cli/CliEndpoint.scala index 4480248472..0067004bb9 100644 --- a/zio-http-cli/src/main/scala/zio/http/endpoint/cli/CliEndpoint.scala +++ b/zio-http-cli/src/main/scala/zio/http/endpoint/cli/CliEndpoint.scala @@ -57,7 +57,7 @@ private[cli] final case class CliEndpoint( lazy val getOptions: List[HttpOptions] = url ++ headers ++ body - def describeOptions(description: Doc) = + def describeOptions(description: Doc): CliEndpoint = self.copy( body = self.body.map(_ ?? description), headers = self.headers.map(_ ?? description), diff --git a/zio-http-cli/src/test/scala/zio/http/endpoint/cli/EndpointGen.scala b/zio-http-cli/src/test/scala/zio/http/endpoint/cli/EndpointGen.scala index 53e532ef58..9c5bb97b2c 100644 --- a/zio-http-cli/src/test/scala/zio/http/endpoint/cli/EndpointGen.scala +++ b/zio-http-cli/src/test/scala/zio/http/endpoint/cli/EndpointGen.scala @@ -119,7 +119,7 @@ object EndpointGen { ) def withDoc[A] = Mapper[CliReprOf[Codec[A]], Doc]( - (repr, doc) => CliRepr(repr.value ?? doc, repr.repr.copy(body = repr.repr.body.map(_ ?? doc))), + (repr, doc) => CliRepr(repr.value ?? doc, repr.repr.describeOptions(doc)), anyDoc, ) diff --git a/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala b/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala index f654b493cc..88eeac74cf 100644 --- a/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala +++ b/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala @@ -284,7 +284,9 @@ object HttpContentCodec { def only[A](implicit schema: Schema[A]): HttpContentCodec[A] = { HttpContentCodec( ListMap( - MediaType.text.`plain` -> + MediaType.text.`plain` -> + BinaryCodecWithSchema(zio.http.codec.internal.TextBinaryCodec.fromSchema[A](schema), schema), + MediaType.application.`octet-stream` -> BinaryCodecWithSchema(zio.http.codec.internal.TextBinaryCodec.fromSchema[A](schema), schema), ), )