RicoSuter/NJsonSchema

InvalidCastException on validation of JToken containing BigInteger

Open

#568 opened on Nov 25, 2017

View on GitHub
 (11 comments) (0 reactions) (0 assignees)C# (550 forks)github user discovery
help wantedtype: bug

Repository metrics

Stars
 (1,578 stars)
PR merge metrics
 (Avg merge 39d 6h) (1 merged PR in 30d)

Description

Validation of JToken containing System.Numeric.BigInteger leads to InvalidCastException with message: "Object must implement IConvertible.". Exception is thrown on line 289 of JsonSchemaValidator(var value = token.Value();) in method "ValidateNumber".

That's a bug because instead of receiveng error you need to handle this exception in your code.

Contributor guide