Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Json Deserializer throws exception because of wrong type #27

Copy link
Copy link
@Mykke24

Description

@Mykke24
Issue body actions

I am calling: SmallBalance result = apiInstance.listSmallBalance();
I get this Exception: IllegalStateException

Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:520)
	at com.google.gson.Gson.fromJson(Gson.java:1361)
	at com.google.gson.Gson.fromJson(Gson.java:1262)
	at com.google.gson.Gson.fromJson(Gson.java:1171)
	at com.google.gson.Gson.fromJson(Gson.java:1137)
	at io.gate.gateapi.JSON.deserialize(JSON.java:142)
	at io.gate.gateapi.ApiClient.deserialize(ApiClient.java:781)
	at io.gate.gateapi.ApiClient.handleResponse(ApiClient.java:984)
	at io.gate.gateapi.ApiClient.execute(ApiClient.java:911)
	at io.gate.gateapi.api.WalletApi.listSmallBalanceWithHttpInfo(WalletApi.java:2513)
	at io.gate.gateapi.api.WalletApi.listSmallBalance(WalletApi.java:2495)

The deserialize method expects an object, but the json body passed from io.gate.gateapi.ApiClient.deserialize is an array hence the exception:

This is the body that throws the exception:
[{"currency":"BICITY","available_balance":"4.50000000","convertible_to_gt":"0.001038","estimated_as_btc":"0.00000014"}]

I use gate-api version 6.78.0 and gson-2.11.0 (both latest version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.