Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
987Nabil committed Aug 13, 2024
1 parent 2ed8776 commit b36a0af
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, _ }
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit b36a0af

Please sign in to comment.