From b36a0afebb40cd3b572ba6bbfe40d8350095ae2f Mon Sep 17 00:00:00 2001 From: Nabil Abdel-Hafeez <7283535+987Nabil@users.noreply.github.com> Date: Tue, 13 Aug 2024 23:43:59 +0200 Subject: [PATCH] Update dependencies --- .../main/scala/zio/schema/codec/AvroSchemaCodec.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zio-schema-avro/src/main/scala/zio/schema/codec/AvroSchemaCodec.scala b/zio-schema-avro/src/main/scala/zio/schema/codec/AvroSchemaCodec.scala index 95cf24b4c..e7d36a96c 100644 --- a/zio-schema-avro/src/main/scala/zio/schema/codec/AvroSchemaCodec.scala +++ b/zio-schema-avro/src/main/scala/zio/schema/codec/AvroSchemaCodec.scala @@ -3,14 +3,11 @@ package zio.schema.codec import java.nio.charset.StandardCharsets import java.time.format.DateTimeFormatter import java.time.{ Duration, Month, MonthDay, Period, Year, YearMonth } - import scala.annotation.StaticAnnotation import scala.collection.immutable.ListMap import scala.jdk.CollectionConverters._ import scala.util.{ Right, Try } - -import org.apache.avro.{ LogicalTypes, Schema => SchemaAvro } - +import org.apache.avro.{ LogicalTypes, SchemaFormatter, Schema => SchemaAvro } import zio.Chunk import zio.schema.CaseSet.Aux import zio.schema.Schema.{ Record, _ } @@ -864,7 +861,11 @@ object AvroSchemaCodec extends AvroSchemaCodec { private[codec] def toZioTuple(schema: SchemaAvro): scala.util.Either[String, Schema[_]] = for { _ <- scala.util.Either - .cond(schema.getFields.size() == 2, (), "Tuple must have exactly 2 fields:" + schema.toString(false)) + .cond( + schema.getFields.size() == 2, + (), + "Tuple must have exactly 2 fields:" + SchemaFormatter.getInstance("json").format(schema) + ) _1 <- toZioSchema(schema.getFields.get(0).schema()) _2 <- toZioSchema(schema.getFields.get(1).schema()) } yield Schema.Tuple2(_1, _2, buildZioAnnotations(schema))