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
will unfortunately fail in case a Python tuple is passed instead of a list. json.dumps will always transform Python tuples to list, so I don't see why validate should raise an exception on encountering a tuple.
Any insight on how to solve this without having to transform all of my tuples into list before outputting them?
The text was updated successfully, but these errors were encountered:
According to python-jsonschema/jsonschema#148 , a custom validator can be used to solve this issue. tornado-json's validate already allows to pass a format_checker, but this is only use for input validation, not for the output. Was this done on purpose? What would be the issue to passing the same checker when validating the output too?
We are using
@schema.validate
on our controllers.A property defined as
will unfortunately fail in case a Python tuple is passed instead of a list.
json.dumps
will always transform Python tuples to list, so I don't see whyvalidate
should raise an exception on encountering a tuple.Any insight on how to solve this without having to transform all of my tuples into list before outputting them?
The text was updated successfully, but these errors were encountered: