@@ -440,7 +440,7 @@ def schemasCode(
440440 val scalaName = s.id.scalaName
441441 s """ |case class $scalaName(
442442 | ${s
443- .scalaProperties (hasProps)
443+ .sortedProperties (hasProps)
444444 .map { (n, t) =>
445445 val enumType =
446446 if jsonCodec == JsonCodec .ZioJson then SchemaType .EnumType .Literal
@@ -483,7 +483,7 @@ def commonSchemaCodecs(
483483 case (JsonCodec .Jsoniter , ArrayType .ZioChunk ) =>
484484 schemas.toList
485485 .flatMap((sk, sv) =>
486- sv.scalaProperties (hasProps)
486+ sv.sortedProperties (hasProps)
487487 .collect { case (k, Property (_, SchemaType .Array (typ, _), _)) =>
488488 val enumType =
489489 if jsonCodec == JsonCodec .ZioJson then SchemaType .EnumType .Literal
@@ -817,14 +817,12 @@ case class Schema(
817817
818818 // required properties first
819819 // references wihout properties are excluded
820- private def sortedProps (hasProps : SchemaPath => Boolean ): List [(String , Property )] =
820+ def sortedProperties (hasProps : SchemaPath => Boolean ): List [(String , Property )] =
821821 properties
822822 .filter { (_, prop) =>
823823 prop.schemaPath.forall(hasProps(_))
824824 }
825825 .sortBy(_._2.typ.optional)
826- def scalaProperties (hasProps : SchemaPath => Boolean ): List [(String , Property )] =
827- sortedProps(hasProps).map { (k, prop) => (toScalaName(k), prop) }
828826}
829827
830828object Schema :
0 commit comments