-
Notifications
You must be signed in to change notification settings - Fork 146
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
Error when reading json array file? #1071
Comments
Ok so this was a weird one. I was running all the code inside one file, in a Main.scala file. Only this remains, but the result seems to be fine:
|
/bounty $100 |
💎 $100 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-json! |
@SimunKaracic , I cannot reproduce this error, either in tests or in the main class as you mentioned. Could you share the whole Main.scala file by any chance, as well as all relevant environment details regarding your platform, scala version, and zio version (thanks for mentioning the zio json version!). |
I am also not able to reproduce the bug anymore, as I threw away the original exploratory code.
My attempt at reproducing the bug (also tried lowering versions of scala, but it didn't help):
Main.scala:
|
Specifically, this file https://github.com/statsbomb/open-data/blob/master/data/competitions.json
The file is formatted as a json array, and I would like to read the file in a streaming fashion.
When opening the file with:
The entire file is read into a a single item, a json list (instead of providing a stream of each item in the list).
It also throws this error, but seems to recover from it:
When trying this to read the file as a
Stream[Competition]
I get a StackOverflowError
The stack points directly to the derived Competition class json codec.
Class and codec:
ZIO-json version:
0.6.2
The text was updated successfully, but these errors were encountered: