airline
airline copied to clipboard
When numeric range restriction is too narrow a type for field type unhelpful errors are issued
Discovered from $day job testing. When using a numeric range restriction eg IntegerRange
on a field with a wider type eg long
what looks like a valid value can be rejected with an unhelpful error:
Value for option 'MaxIdleTime' was given as '2' which is not in the acceptable range: value >= 1
This is because while the range restriction implementation copes with widening casts eg LongRange
on an int
field it doesn't cope with the inverse.
Implementation should be improved to issue a more specific error in this case since this is an option definition error