plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
84 stars 73 forks source link

debug-exceptions = on in instance part in buildout causes requests that return BadRequest to be returned as html instead of json #1734

Closed wesleybl closed 4 months ago

wesleybl commented 7 months ago

The configuration in question is this:

https://github.com/plone/plone.restapi/blob/30102e8c50d2829472ba5fba837362c7073b97f4/base.cfg#L41

It took me a considerable amount of time to figure out what was going on. I was using the plone.restapi buildout to test validation errors with Volto. Validation errors return BadRequest. So the validation messages were strange in my tests.

I removed this setting and the tests worked. This configuration was added by @tisto in the commit: https://github.com/plone/plone.restapi/commit/8832625c5484c4d4c17b6ceb057f66aa3c14b245

It seems like it is a necessary configuration in performance tests. We have a buildout for performance testing. So I ask if we can leave this configuration there only.