mozilla-services/cornice — pull request #116 by rach (2013-02-21 00:55:58+00:00)
Title: check the __json__ magic method before serialising the object

To be more compliant with the current implementation of Pyramid:

http://docs.pylonsproject.org/projects/pyramid/en/master/narr/renderers.html#serializing-custom-objects

https://github.com/Pylons/pyramid/blob/master/pyramid/renderers.py#L263

It will be great if cornice could support the __json__ method to makes life easier.

By the way, couldn't you reuse the Json Renderer from Pyramid and specify you own `serializer`

https://github.com/Pylons/pyramid/blob/master/pyramid/renderers.py#L263

from pyramid.renderers impor JSON
cornice_renderer = JSON(serializer=simplejson.dumps)