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.