msrest-for-python icon indicating copy to clipboard operation
msrest-for-python copied to clipboard

The message in ValidationError is not correct

Open zhoxing-ms opened this issue 5 years ago • 1 comments

Error Message:

# in msrest.exceptions
_messages = {
    "min_length": "must have length greater than {!r}.",
    "max_length": "must have length less than {!r}.",
    ...
}

code link: click

Validation Logic:

# in msrest.serialization
validation = {
    "min_length": lambda x, y: len(x) < y,
    "max_length": lambda x, y: len(x) > y,
    ...
}

code link: click

Expected Message: According to the validation logic, the correct message should be

_messages = {
    "min_length": "must have length equal to or greater than {!r}.",
    "max_length": "must have length equal to or less than {!r}.",
    ...
}

zhoxing-ms avatar Aug 07 '20 02:08 zhoxing-ms

@lmazuel Could you please help to have a look~

zhoxing-ms avatar Jan 11 '21 09:01 zhoxing-ms