Reputation: 31
We have some numeric fields, that for legacy reasons have implicit length limits.
Given a number field with a length limit of 5, the obvious route is to set the max to 99999, but then is there any way to specify that 1.111 is ok, and 1.1111 is not, in the swagger spec?
For example:
numberField:
type: number
format: float
minimum: 0
maximum: 99999
Upvotes: 3
Views: 6595
Reputation: 6946
Yes, you have to use the property maxLength
numberField:
type: number
format: float
maxLength: 5
Upvotes: 0