You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '>' cannot be applied to operands of type 'string' and 'double'.
If I use a range attribute like this: [Range(typeof(decimal), "0", "1")]
The exception is thrown in the ApplyDataAnnotations method in JsonSchemaGenerator.cs.
This is probably because the used constructor for the RangeAttribute sets the properties Minimum and Maximum to a string value and this causes the comparison done at line 945 in JsonSchemaGenerator to throw the exception.
if (rangeAttribute.Minimum != null && rangeAttribute.Minimum > double.MinValue)
All you need to do to reproduce this exception is to use the Range attribute on a decimal property like I did.
The text was updated successfully, but these errors were encountered:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '>' cannot be applied to operands of type 'string' and 'double'.
If I use a range attribute like this:
[Range(typeof(decimal), "0", "1")]
The exception is thrown in the ApplyDataAnnotations method in JsonSchemaGenerator.cs.
This is probably because the used constructor for the RangeAttribute sets the properties Minimum and Maximum to a string value and this causes the comparison done at line 945 in JsonSchemaGenerator to throw the exception.
if (rangeAttribute.Minimum != null && rangeAttribute.Minimum > double.MinValue)
All you need to do to reproduce this exception is to use the Range attribute on a decimal property like I did.
The text was updated successfully, but these errors were encountered: