Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derived JsonDecoder decodeJson vs fromJsonAST error inconsistency #766

Open
andreisilviudragnea opened this issue Oct 20, 2022 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@andreisilviudragnea
Copy link

andreisilviudragnea commented Oct 20, 2022

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.

@andreisilviudragnea andreisilviudragnea changed the title Derived JsonDecoder decodeJson vs fromJsonAST error consistency Derived JsonDecoder decodeJson vs fromJsonAST error inconsistency Oct 24, 2022
@andreisilviudragnea
Copy link
Author

@fsvehla

@fsvehla fsvehla added the help wanted Extra attention is needed label Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants