sunlightlabs/validictory — Issue #14: additionalProperties causes a 'int' object not iterable error
Author: ericmjonas
Created: 2012-02-01 01:16:00+00:00
State: open

```python
def test_nested(self):
x = {'rows' : [1, 2, 3]}

schema = {'type' : 'object',
'properties' : {
'rows' : { 'type' : 'array',
'items' : {'type' : 'object',
'properties' : {'_id' : {'type' : 'string'}},
'additionalProperties' : {'type' : 'number'}}}}}

valedictory.validate(x, schema)
```

Gives

```
File "/home/jonas/veritable/validictory/validictory/validator.py", line 267, in validate_additionalProperties
for eachProperty in value:
TypeError: 'int' object is not iterable
```

Now this appears to be caused by additionalProperties in the schema being checked prior to the 'type' operator. I've forked validictory and think I have a work-around -- I'll submit a pull request soon in the next hr.

Thanks for making such a great project!