File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
zio-schema-avro/src/main/scala/zio/schema/codec Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ object BuildHelper {
3838 val zioPreludeVersion = " 1.0.0-RC39"
3939 val zioOpticsVersion = " 0.2.2"
4040 val zioBsonVersion = " 1.0.6"
41- val avroVersion = " 1.11.4 "
41+ val avroVersion = " 1.12.0 "
4242 val bsonVersion = " 4.11.3"
4343 val zioConstraintlessVersion = " 0.3.3"
4444 val scalaCollectionCompatVersion = " 2.13.0"
Original file line number Diff line number Diff line change @@ -466,18 +466,17 @@ object AvroCodec {
466466
467467 }
468468 private def decodeSequence [A ](a : A , schema : Schema [A ]) = {
469- val array = a.asInstanceOf [GenericData .Array [Any ]]
470- val result = array.asScala.toList. map(decodeValue(_, schema))
471- val traversed : Either [ List [ DecodeError ], List [ A ]] = result.partition(_.isLeft) match {
469+ val array = a.asInstanceOf [GenericData .AbstractArray [Any ]]
470+ val result = array.asScala.map(decodeValue(_, schema))
471+ val traversed = result.partition(_.isLeft) match {
472472 case (Nil , decoded) => Right (for (Right (i) <- decoded) yield i)
473473 case (errors, _) => Left (for (Left (s) <- errors) yield s)
474474 }
475- val combined : Either [ DecodeError , List [ A ]] = traversed.left.map { errors =>
475+ val combined = traversed.left.map { errors =>
476476 errors.foldLeft[DecodeError ](DecodeError .MalformedFieldWithPath (Chunk .empty, " Sequence decoding failed." ))(
477477 (acc, error) => acc.and(DecodeError .MalformedFieldWithPath (Chunk .empty, s " ${error.message}" ))
478478 )
479479 }
480-
481480 combined.map(Chunk .fromIterable(_))
482481 }
483482
You can’t perform that action at this time.
0 commit comments