diff --git a/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala b/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala index b53716229..7107211b9 100644 --- a/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala +++ b/zio-schema-json/shared/src/main/scala/zio/schema/codec/JsonCodec.scala @@ -152,10 +152,10 @@ object JsonCodec { }, err => if (stringBuilder.isEmpty) ZChannel.refailCause(err) - else ZChannel.write(Chunk.single(stringBuilder.result)) *> ZChannel.refailCause(err), + else ZChannel.write(Chunk.single(stringBuilder.result())) *> ZChannel.refailCause(err), done => if (stringBuilder.isEmpty) ZChannel.succeed(done) - else ZChannel.write(Chunk.single(stringBuilder.result)) *> ZChannel.succeed(done) + else ZChannel.write(Chunk.single(stringBuilder.result())) *> ZChannel.succeed(done) ) ZPipeline.fromChannel(loop)