Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case-insensitive deserialization... Aargh #52

Closed
wallace1981 opened this issue Mar 12, 2018 · 1 comment
Closed

Case-insensitive deserialization... Aargh #52

wallace1981 opened this issue Mar 12, 2018 · 1 comment

Comments

@wallace1981
Copy link

Hi,
The issue I faced was with Trades stream. BinanceStreamTrade.BuyerIsMaker was always True, so my guess was that it is picking from "M" field in JSON. The way I proove it is simple (see below). Unfortunately, it looks like there is no fix from Newtonsoft (JamesNK/Newtonsoft.Json#815). May be having below solution will be ok for your releases, anyway it's up to you. This issue may popup some other places too, but so far I notices only this.

public class BinanceStreamTrade: BinanceStreamEvent
{

...
// added this so it will pick M, and m will be where it should be.
// I have no idea why it works, but...
[JsonProperty("M")]
public bool Ignore { get; set; }
[JsonProperty("m")]
public bool BuyerIsMaker { get; set; }

@wallace1981 wallace1981 changed the title Case-insensitive deserializition... Aargh Case-insensitive deserialization... Aargh Mar 12, 2018
@JKorf
Copy link
Owner

JKorf commented Mar 13, 2018

Hi, I've seen this issue before yes, Solution is as you noted, add a property to map the unused property to make sure the other one gets mapped properly. I've fixed this in the latest version (3.0.9). Thanks for notifying me of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants