Skip to content

Derived JsonDecoder decodeJson vs fromJsonAST error inconsistency #766

Closed
@andreisilviudragnea

Description

@andreisilviudragnea
JsonDecoder {
  final def decodeJson(str: CharSequence): Either[String, A]
  def fromJsonAST(json: Json): Either[String, A]
}
  • Derived JsonDecoders have different errors for:
    • missing fields when calling JsonDecoder.decodeJson (".b.c.v2(missing)") vs JsonDecoder.fromJsonAST ("Missing fields: v2, v3")
    • invalid types when calling JsonDecoder.decodeJson (".b.c.v1(expected '\"' got '1')") vs JsonDecoder.fromJsonAST ("Not a string value").
  • 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.

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions