Azure / msrest-for-python

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

Validation failed if string is valid integer, but minimum/maximum is used. #85

Closed lmazuel closed 4 years ago

lmazuel commented 6 years ago

Example from @derekbekoe

>>> ExpressRouteCircuitPeering(peer_asn='10002').validate()
[ValidationError("Parameter 'ExpressRouteCircuitPeering.peer_asn' failed to meet validation requirement.",)]

I see no reason to refuse that, and should take a look

lmazuel commented 6 years ago

Ok I get it actually, there is integer rules:

    _validation = {
        'peer_asn': {'maximum': 4294967295, 'minimum': 1},
    }

This tests the validation before the cast to int/long. These validations rules was added at the same time type changed from int to long, but the problem is not related to the type.