pyopenapi / pyswagger

An OpenAPI (fka Swagger) client & converter in python, which is type-safe, dynamic, spec-compliant.
MIT License
385 stars 90 forks source link

Format in validation length will cause error #33

Closed marcinma closed 9 years ago

marcinma commented 9 years ago

In primitives lines 116 - 119

if obj.minItems and len(self) < obj.minItems:
            raise errs.ValidationError('Array should be more than {0}, not {1}'.format(o.minItems, len(self)))
if obj.maxItems and len(self) > obj.maxItems:
            raise errs.ValidationError('Array should be less than {0}, not {1}'.format(o.maxItems, len(self)))

o is not defined and should be replaced to obj

mission-liao commented 9 years ago

thanks for pointing out, there must be some test case missed.

mission-liao commented 9 years ago

thx for reporting issues, this issue is fixed in v0.8.9.