Skip to content

SessionLogonResponseResult class deserialization exception when setAutoLogon == true #182

@lz-44

Description

@lz-44

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions