Uh oh!
There was an error while loading. Please reload this page.
Improve Enum handling - #10
Merged
Merged
Conversation
…attribute to ensure the mapping is done properly
brewdente
commented
Oct 4, 2016
Member
Again, great stuff here. The tests failed though :( |
brewdente
commented
Oct 4, 2016
Member
At least, that's what the AppVeyor build is reporting: https://ci.appveyor.com/project/brewdente/chromedevtools/build/1.0.39 |
qmfrederik
commented
Nov 9, 2016
ContributorAuthor
@brewdente Sorry it took some time, fixed it, build should be green now. |
qmfrederikforce-pushed
the
fixes/enum-handling
branch
from
November 9, 2016 21:47
0b0b669 to
9170965Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-agentwhich becomesUser_Agentin 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 theStringEnumConverter, which works around this problem.