Closed
Description
JsonDecoder {
final def decodeJson(str: CharSequence): Either[String, A]
def fromJsonAST(json: Json): Either[String, A]
}
- Derived
JsonDecoder
s have different errors for:- missing fields when calling
JsonDecoder.decodeJson
(".b.c.v2(missing)"
) vsJsonDecoder.fromJsonAST
("Missing fields: v2, v3"
) - invalid types when calling
JsonDecoder.decodeJson
(".b.c.v1(expected '\"' got '1')"
) vsJsonDecoder.fromJsonAST
("Not a string value"
).
- missing fields when calling
- The errors reported by
JsonDecoder.fromJsonAST
seem to be broken because the JSON path to the error is missing from the messages:"Missing fields: v2, v3"
,"Not a string value"
.
I opened a PR with a test for this incosistency: #765.