Skip to content

Exception: The JSON value could not be converted to System.String. Path: $.filter.account #4

@VozyakovAV

Description

@VozyakovAV

Description:
When subscribing to position updates via _client.ExchangeApi.SubscribeToPositionUpdatesAsync, a JsonException occurs during deserialization. The error message is:
System.Text.Json.JsonException: 'The JSON value could not be converted to System.String. Path: $.filter.account | LineNumber: 0 | BytePositionInLine: 1374.'

Root Cause:
The Filter property in SocketUpdate is defined as Dictionary<string, string>. However, the incoming JSON contains a numeric value for account inside filter:

json
"filter": {
"account": 146313
}

Since account is a number (146313) in the JSON, but the deserializer expects a string (per Dictionary<string, string>), the conversion fails.

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