Skip to content

Jil.DeserializationException: Expected: ", null #20

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

Open
93Omar opened this issue Feb 7, 2021 · 5 comments · May be fixed by #21
Open

Jil.DeserializationException: Expected: ", null #20

93Omar opened this issue Feb 7, 2021 · 5 comments · May be fixed by #21

Comments

@93Omar
Copy link
Contributor

93Omar commented Feb 7, 2021

Calling GetSong with songid 6267625

geniusClient.SongClient.GetSong(6267625);

throws this exception:

Jil.DeserializationException: Expected: ", null

Seems like there is something wrong with the deserialization but I can't find the error since I'm not familiar with the Jil library. I can't find a way to handle deserialization errors with this library in order to get a more "talking error".
Have you considered using the more popular Newtonsoft.Json?

@prajjwaldimri
Copy link
Owner

I used Jil because it is much more performant than other libraries. Check out the benchmarks here: https://github.com/kevin-montrose/Jil#serialization

@93Omar
Copy link
Contributor Author

93Omar commented Feb 7, 2021

Yes, I saw that but seems like I can't handle serialization/deserialization errors like I could do with Newtonsoft.Json.
I think I will try to map again the SongResponse model from a example JSON response since I think there is something wrong there.

@prajjwaldimri
Copy link
Owner

Most probably the issue is that genius changed the response that their api sends when getting a Song, so it isn't able to handle some unmapped fields

@93Omar
Copy link
Contributor Author

93Omar commented Feb 7, 2021

Yes, I agree. I will open a PR if I will be able to solve the issue.

@prajjwaldimri
Copy link
Owner

Alright. If we couldn't solve this issue, we will switch this library to Newtonsoft.Json

@93Omar 93Omar linked a pull request Feb 7, 2021 that will close this issue
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.

2 participants