mozilla-services/cornice — pull request #218 by thruflo (2014-02-06 16:17:15+00:00)
Title: Use configurable Pyramid JSON renderer.

This is an alternative implementation to #116 by @rach.

What I've done is re-implement Cornice's custom content-type header
logic and use_decimal=True kwarg on top of the Pyramid JSON renderer.

This allows the renderer to be configured by a Pyramid app that
`config.include('cornice')`s, whilst retaining backwards compatibility
with previous versions of Cornice.

Note that the current implementation still doesn't extend to serializing
JSON errors with the configurable renderer -- that could be done by
fetching the current request from threadlocals in the `_JSONError`
class but it wasn't clear to me whether errors would normally require
configurable serialization.