Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
pablf committed Jun 30, 2024
1 parent 4f5497f commit 228b57c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,9 @@ object JsonCodec {
}.toMap

// if all cases are CaseClass0, decode as String
if (cases.forall(_.schema.isInstanceOf[Schema.CaseClass0[_]])) {
if (schema.annotations.exists(_.isInstanceOf[simpleEnum]) && cases.forall(
_.schema.isInstanceOf[Schema.CaseClass0[_]]
)) {
val caseMap: Map[String, Z] =
cases.map(case_ => case_.id -> case_.schema.asInstanceOf[Schema.CaseClass0[Z]].defaultConstruct()).toMap
ZJsonDecoder.string.mapOrFail(
Expand Down

0 comments on commit 228b57c

Please sign in to comment.