Skip to content

Commit

Permalink
Fix error messages for field decoder implementation of string-like va…
Browse files Browse the repository at this point in the history
…lues
  • Loading branch information
plokhotnyuk committed Jan 26, 2025
1 parent 227a64a commit 5c5347c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object DerivedDecoderSpec extends ZIOSpecDefault {
case class Foo(aOrB: Map["A" | "B", Int]) derives JsonDecoder

assertTrue("""{"aOrB": {"A": 1, "B": 2}}""".fromJson[Foo] == Right(Foo(Map("A" -> 1, "B" -> 2)))) &&
assertTrue("""{"aOrB": {"C": 1}}""".fromJson[Foo] == Left(".aOrB.C((expected one of: A, B))"))
assertTrue("""{"aOrB": {"C": 1}}""".fromJson[Foo] == Left(".aOrB.C(expected one of: A, B)"))
}
)
}

0 comments on commit 5c5347c

Please sign in to comment.