You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an array of types is used in a schema ('type': ['string', 'number']), the Eve serializer (the function serialize in common.py) will fail with the exception 'unhashable list'. This can be hard to find, because the serializer swallows exceptions and sometimes the request will go through OK, but sometimes it will fail because the serializer didn't serialize everything correctly.
Example (the exception is thrown with this schema at common.py:423):
When I POST a new item to this schema, it will either insert it and return 201 or return 422 with the error "timestamp": "must be of datetime type". This depends on the order in which the serializer goes through the fields, which is non-deterministic. Either it serializes the datetime first, then it's ok, or it finds the constraint 'type': ['string', 'number'] which stops the serializer, the datetime stays unparsed and the request fails.
Is array of types supported by Eve? It is officially supported by Cerberus. I tried replacing it with 'anyof_type': ['string', 'number'], but that returns an error (no definitions validate).
Version: 0.8-dev from latest github master (commit sha 1d4a308)
Python version: happens both on 2.7 and 3.5
The text was updated successfully, but these errors were encountered:
When an array of types is used in a schema (
'type': ['string', 'number']
), the Eve serializer (the function serialize incommon.py
) will fail with the exception 'unhashable list'. This can be hard to find, because the serializer swallows exceptions and sometimes the request will go through OK, but sometimes it will fail because the serializer didn't serialize everything correctly.Example (the exception is thrown with this schema at
common.py:423
):When I POST a new item to this schema, it will either insert it and return 201 or return 422 with the error
"timestamp": "must be of datetime type"
. This depends on the order in which the serializer goes through the fields, which is non-deterministic. Either it serializes the datetime first, then it's ok, or it finds the constraint'type': ['string', 'number']
which stops the serializer, the datetime stays unparsed and the request fails.Is array of types supported by Eve? It is officially supported by Cerberus. I tried replacing it with
'anyof_type': ['string', 'number']
, but that returns an error (no definitions validate
).Version: 0.8-dev from latest github master (commit sha 1d4a308)
Python version: happens both on 2.7 and 3.5
The text was updated successfully, but these errors were encountered: