Open bluelight773 opened 2 years ago
This problem still occurs on v5.17.14. Occurs for both Swagger 2.0 and OAS 3.1. For example:
{
"paths": {
"/v1/some/endpoint": {
"get": {
"parameters": [
{
"description": "Some int param with accepted values: 5 - 12",
"in": "query",
"name": "some_int_param",
"schema": {
"default": 7,
"maximum": 12,
"minimum": 5,
"type": "integer"
}
Validation error on Swagger UI:
Are there any plans to address it in near future? Thank you in advance.
Q&A (please complete the following information)
Content & configuration
You can simply use Swagger Editor (https://editor.swagger.io/), use the following YAML, then just try entering
0
or11
forint_parameter
via the "Try it out" feature then check the inaccurate error message.Example Swagger/OpenAPI definition:
Swagger-UI configuration options: Not sure, but you can simply use https://editor.swagger.io/ to reproduce the error.
Describe the bug you're encountering
The error message shown for entering an integer that is above the maximum or below the minimum is in accurate. Instead of stating, "Value must be greater than or equal to 1", it states "Value must be greater than 1". Instead of stating "Value must be less than or equal to 10", it states "Value must be less than 10".
Note, however, that the actual validation, that is, checking that the value is within 1 to 10 inclusive is done correctly. The problem is just with the error message shown when you enter a value out of range.
To reproduce...
Steps to reproduce the behavior:
/test_endpoint/
to expand itint_parameter
textboxint_parameter
textbox to see the error message. You'll see "Value must be greater than 1" if 0 was entered, and "Value must be less than 10" if 11 was entered.Expected behavior
The error message should state "Value must be greater than or equal to 1" if 0 was entered, and state "Value must be less than or equal to 10" if 11 was entered.