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

Android version fails to deserialize nullable enum #11

Open
tho-sch opened this issue Mar 22, 2016 · 0 comments
Open

Android version fails to deserialize nullable enum #11

tho-sch opened this issue Mar 22, 2016 · 0 comments

Comments

@tho-sch
Copy link

tho-sch commented Mar 22, 2016

I am using version 2.0.0.6 (latest on NuGet) in a Xamarin.Android project targeting API Level 15. The following Json string fails to deserialize:
{"NewDataAvailable":false,"ServiceAction":null}

This is the corresponding class:

[DataContract]
public class DeviceNotification
{
    [DataMember]
    public bool NewDataAvailable { get; set; }

    [DataMember]
    public DeviceServiceAction? ServiceAction { get; set; }
}

DeviceServiceAction is an enum.

When trying to deserialize, I receive the following error:
System.Exception: Bad number (int) at 42 (found: '\110')

The problem only occurs when ServiceAction is null.

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

1 participant