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

Failure to convert TypeSafeEnum should prevent successful parsing #4

Closed
bartelink opened this issue Oct 10, 2018 · 1 comment
Closed

Comments

@bartelink
Copy link
Collaborator

bartelink commented Oct 10, 2018

Given:

[<Newtonsoft.Json.JsonConverter(typeof<TypeSafeEnumConverter>)>]
type Log = A | B
[<Newtonsoft.Json.JsonConverter(typeof<UnionConverter>, "rule", "Unknown")>] Input =
type DU of = 
    | CaseA of req: Log * res:Log 

the following parses, yielding a Log value of null and NullReferenceException when you touch the res value

"{ "rule": "CaseA", "req": "A" }

this should instead provide a clear parser error

@bartelink
Copy link
Collaborator Author

Resolved by #5

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