Adding more verbose validation error messages in case of both "min_value" and "max_value" limits are set. #7777
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
No global issues solved, just a tiny fix:
Imagine such a field within our API:
value = serializers.IntegerField(min_value=10, max_value=30)
Let's assume the User makes the request to our API with such a payload: {"value": 5}
The API answers: "Ensure this value is greater than or equal to 10"
User updates the payload with {"value": 50}
The API answers: "Ensure this value is less than or equal to 30"
With current fix the very first response from the API would be: "Ensure this value is in the range between 10 and 30." which is more verbose for the API users.