nicehash/rest-clients-demo

Java Sample Returning JsonSyntaxException

phamsarah opened this issue · 1 comments

Exception in thread "main" com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonArray but was com.google.gson.JsonObject
at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:897)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at Exch.(Exch.java:56)
at Exch.main(Exch.java:26)

I made sure my Organization Id, API key, and API secret were all correct by using this: https://www.nicehash.com/docs/rest and inputting the same values and getting a 200 response code.

I'm also using the production api2 for the URL_ROOT, Ran Exch.java and getting the exception above.

bl4z commented

This has been fixed - this just indicates that response form server is object not array (json) - see latest commits