mozilla-services/cornice — pull request #150 by Natim (2014-07-30 11:13:31+00:00)
Title: Extra renderer on view overrides default

If I add an extra renderer, with a specific ``accept`` mimetype, it becomes the default one ! Order of decorators had no effect.

Example ([taken from here](https://github.com/spiral-project/daybed/blob/geojson/daybed/views/data.py#L9-L31))

```python
data = Service(name='data',
path='/data/{model_name}',
description='Model data',
renderer='jsonp')

@data.get()
@data.get(accept='application/geojson', renderer='geojson')
def get(request):
"""Retrieves all model records."""
model_name = request.matchdict['model_name']
...
return {'data': data}
```

**Implicit** uses the **additionnal** renderer :

```javascript
curl -i http://localhost:8000/data/model
HTTP/1.1 200 OK
Content-Length: 470
Content-Type: application/json; charset=UTF-8
Date: Mon, 03 Jun 2013 08:30:24 GMT
Server: waitress

{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": "[1.8814086914062498,47.89424772020999]"}...]}%
```

**Explicit** accept "json" is ok :

```javascript
curl -i -H "Accept: application/json" http://localhost:8000/data/model
HTTP/1.1 200 OK
Content-Length: 305
Content-Type: application/json; charset=UTF-8
Date: Mon, 03 Jun 2013 08:30:07 GMT
Server: waitress

{"data": [{"emplacement": "[1.8814086914062498,47.89424772020999]", "couleur": "darkblue", "categorie": "flag", "id": "f32a5926a928604621ce12f62a34e3b6"}, ...}%
```

And of course, targetting the additional renderer works...

```javascript
curl -i -H "Accept: application/geojson" http://localhost:8000/data/model
HTTP/1.1 200 OK
Content-Length: 470
Content-Type: application/json; charset=UTF-8
Date: Mon, 03 Jun 2013 08:30:12 GMT
Server: waitress

{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": "[1.8814086914062498,47.89424772020999]"}...]}%
```