plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
86 stars 78 forks source link

problem with jsonification of dexterity validation errors #496

Open tdesvenain opened 6 years ago

tdesvenain commented 6 years ago

in plone.rest we serialize exceptions with a string cast https://github.com/plone/plone.rest/blob/master/src/plone/rest/errors.py#L37

in plone.restapi, we raise BadRequest with a list of dictionaries as a parameter when we have dexterity fields validation error. https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/deserializer/dxcontent.py#L114

this results in wrong json (with single quotes, unicode prefixes (u''), classes...)

i'm not sure how to fix this

tdesvenain commented 6 years ago

cc @Gagaro

tisto commented 6 years ago

@tdesvenain I think we should try to improve the exception message in plone.rest.