Skip to content

Conversation

@qmfrederik
Copy link
Contributor

In some cases, the C# enum name does not match the JSON enum name (for example, when the enum name includes a hyphen, such as user-agent which becomes User_Agent in C#).

If that is the case, JSON.NET does not know how to do the mapping and errors out.

This PR adds an explicit [EnumMember(Value = "user-agent")] attribute to the enum value, and instructs JSON.NET to use the StringEnumConverter, which works around this problem.

@brewdente
Copy link
Member

Again, great stuff here. The tests failed though :(

@brewdente
Copy link
Member

At least, that's what the AppVeyor build is reporting: https://ci.appveyor.com/project/brewdente/chromedevtools/build/1.0.39

@qmfrederik
Copy link
Contributor Author

@brewdente Sorry it took some time, fixed it, build should be green now.

@brewdente brewdente merged commit 8d30330 into MasterDevs:master Nov 23, 2016
@qmfrederik qmfrederik deleted the fixes/enum-handling branch December 23, 2016 22:10
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

Successfully merging this pull request may close these issues.

2 participants