Swashbuckle.AspNetCore icon indicating copy to clipboard operation
Swashbuckle.AspNetCore copied to clipboard

Automatically set Range attribute on int16(short) properties

Open Stijnwingens opened this issue 3 years ago • 1 comments

Dear fellow devs,

Could a feature be added where: if the RangeAttribute is not set on a property of type short a RangeAttribute is automatically added with values short.MinValue and short.MaxValue.

Since OpenApi does not support Int16, this is the only way to easily make clear what values are valid. I've considered building this functionality myself, but it should be basic functionality.

Of course, same goes for int32, where Range should potentially be int32.MinRange < value < int32.MaxValue.

Doesn't sound like a huge amount of work, so was hoping this could be added sometime in the future.

Stijnwingens avatar Aug 04 '22 13:08 Stijnwingens

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

github-actions[bot] avatar Apr 19 '24 01:04 github-actions[bot]