Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

The message in ValidationError is not correct #219

Open zhoxing-ms opened 4 years ago

zhoxing-ms commented 4 years ago

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 commented 3 years ago

@lmazuel Could you please help to have a look~