binance / binance/binance-connector-java

SessionLogonResponseResult class deserialization exception when setAutoLogon == true

Open
#182 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
581
Forks
255
Avg merge
2m
Merged PRs (30d)
2

Description

When using WebSocketClientConfiguration setAutoLogon == true, exception occurred:

```
c.b.c.c.c.w.adapter.ConnectionWrapper : Exception while receiving message from WS connection

java.lang.IllegalArgumentException: Class com.binance.connector.client.common.websocket.dtos.SessionLogonResponseResult declares multiple JSON fields named 'apiKey'; conflict is caused by fields com.binance.connector.client.common.websocket.dtos.SessionLogonResponseResult#apiKey and com.binance.connector.client.common.websocket.dtos.BaseRequestDTO#apiKey

```

example:

``` java
public SpotWebSocketApi getSpotWebSocketApi() {
SignatureConfiguration signatureConfiguration = new SignatureConfiguration();
signatureConfiguration.setApiKey(properties.getApiKey());
signatureConfiguration.setSecretKey(properties.getApiSecret());
WebSocketClientConfiguration config = SpotWebSocketApiUtil.getClientConfiguration();

config.setAutoLogon(true);

config.setSignatureConfiguration(signatureConfiguration);
return new SpotWebSocketApi(config);
}
```

Indeed, SessionLogonResponseResult has field apiKey. The ancestor BaseRequestDTO has also apiKey field.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.