7.1.9
Fixed — Issue #222: numeric bounds from small integer types were silently dropped
Validation bounds whose value is a small integer type (short/byte/ushort/uint/ulong/sbyte) produced no minimum/maximum in the generated schema. The Between/Comparison rules matched, but IsNumeric did not recognize the boxed value, so the bound was skipped — even though the property is emitted as "type": "integer".
RuleFor(x => x.Quantity).InclusiveBetween((short)1, (short)99);
// before: { "type": "integer", "format": "int16" }
// after: { "type": "integer", "format": "int16", "minimum": 1, "maximum": 99 }IsNumericin the shared core (MicroElements.OpenApi.FluentValidation) now recognizes all integer primitives —sbyte/byte/short/ushort/int/uint/long/ulong— in addition tofloat/double/decimal/BigInteger.NumericToDecimalalready converted them all.- One change in the shared core fixes all three providers: Swashbuckle, NSwag, and the native Microsoft.AspNetCore.OpenApi transformer.
- No overflow risk:
decimalcomfortably coversulong.MaxValue, andBigIntegerkeeps its dedicated branch. - Purely additive — no behavior change for the already-supported numeric types.
Thanks to @send0xx for the precise report and the proposed fix.
Full changelog: https://github.com/micro-elements/MicroElements.Swashbuckle.FluentValidation/blob/master/CHANGELOG.md