Closed nicolaiarocci closed 11 years ago
Actually yes, you're right. I totally missed the enum functonality. One thing however that I don't like about enum is that it validates an empty array. In my use case (and i would assume in most cases where you provide a list of valid values) an empty list should not validate. I could patch validat_enum to raise a ValueError in case of empty array, what do you think?
closed the pull request by mistake. Of course it will end up being closed soon enough :)
sorry, missed this being reopened somehow. if you don't want an empty array you can specify a min length of 1 as well as an enum for the allowed values
Used instead of 'items', this property provides a list of values to match against a list. At least one value must be present. Allowed values include strings, numbers, lists and objects.