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

Decoders (at least some of them) don't accumulate errors #372

Closed
jisantuc opened this issue Jul 29, 2021 · 0 comments · Fixed by #373
Closed

Decoders (at least some of them) don't accumulate errors #372

jisantuc opened this issue Jul 29, 2021 · 0 comments · Fixed by #373

Comments

@jisantuc
Copy link
Contributor

Describe the bug
When you call decodeAccumulating on an empty json object for something with several fields, you should see several errors. Instead, this happens:

scala> decode[StacCollection]("""{}""")
res0: Either[io.circe.Error,com.azavea.stac4s.StacCollection] = Left(DecodingFailure(Attempt to decode value on failed cursor, List(DownField(type))))

scala> decodeAccumulating[StacCollection]("""{}""")
res1: cats.data.ValidatedNel[io.circe.Error,com.azavea.stac4s.StacCollection] = Invalid(NonEmptyList(DecodingFailure(Attempt to decode value on failed cursor, List(DownField(type)))))

Expected behavior
All errors are reported

Additional context
It's really hard to report useful API errors without this 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant