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

Json exception when trying to obtain list of CoinMarkets #5

Closed
pabloim1 opened this issue Aug 6, 2020 · 11 comments
Closed

Json exception when trying to obtain list of CoinMarkets #5

pabloim1 opened this issue Aug 6, 2020 · 11 comments

Comments

@pabloim1
Copy link

pabloim1 commented Aug 6, 2020

When trying to use method getCoinMarkets, the response is always:
Unexpected JSON token at offset 156: Failed to parse 'long'.
JSON input: .....3579","current_price":11864.4,"market_cap":218935913104,"mar.....

@DrewCarlson
Copy link
Owner

Thanks for the report!

The current price field needs to be changed to a Double, I will update shortly.

@SerialName("current_price")
val currentPrice: Long = 0,

@DrewCarlson
Copy link
Owner

I've resolved the CoinMarkets serialization errors in version 0.1.2 with 195ca05.

@pabloim1
Copy link
Author

pabloim1 commented Aug 6, 2020

Same issue with marketCapChange24h
Unexpected JSON token at offset 1075: Failed to parse 'long'.
JSON input: .....ange_24h":-16411987808.987793,"market_cap_change_percentage_.....
Response example:
"market_cap_change_24h": -339302505.56848145,

And i think that for some coins, totalVolume will also be a double.
No sure about field marketCap.

@DrewCarlson
Copy link
Owner

OK, thanks for reporting again. I only used Bitcoin in the test, though I see more should have been added. Will do a more thorough check and get back to you.

@DrewCarlson
Copy link
Owner

Version 0.1.3 should be available shortly. Let me know if any other endpoints give you trouble.

@pabloim1
Copy link
Author

pabloim1 commented Aug 6, 2020

Thank you very much for the quick response and fix!!

@pabloim1
Copy link
Author

pabloim1 commented Aug 6, 2020

Sorry, just tested, new issue
Unexpected JSON token at offset 60872: Expected string or non-null literal.
JSON input: ....._volume":133562280,"high_24h":null,"low_24h":null,"price_cha.....

I guess high24 and low24 can be null. Probably the same with most fields.

@DrewCarlson
Copy link
Owner

That specific error is considered in #1, there is a fix available that I will apply.

Can I ask if you are only using the JVM/Android artifacts?

@pabloim1
Copy link
Author

pabloim1 commented Aug 6, 2020

Yes, I'm only using the JVM/Android artifact.

@DrewCarlson
Copy link
Owner

Can you try version 0.1.4-1.4.0-rc and see if that resolves the nullability error?

@pabloim1
Copy link
Author

pabloim1 commented Aug 6, 2020

Just tested. It does solved the nullability error. Now I can fetch the first 100 coins without any errors.

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

No branches or pull requests

2 participants