Closed almet closed 9 years ago
After two POST for a todo:
http POST http://localhost:8000/models/todo/records item="work on daybed" status="done" --verbose
I have:
{
"features": [
{
"id": null,
"properties": {
"item": "work on daybed",
"status": "done"
},
"type": "Feature"
},
{
"id": null,
"properties": {
"item": "work on daybed",
"status": "done"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
Thinking again, that's valid, since we're not asking for a particular mime type, but I would expect this to be json by default.
If you ask for json, you actually get json so that works.
@leplatrem any thoughts on this one?
Yep, this is a ticket I opened in cornice : https://github.com/mozilla-services/cornice/issues/150
Also geojson is the default for Daybed so if you don't specify it to be JSON you will get geojson.
http GET http://localhost:8000/models/todo/records
HTTP/1.1 200 OK
Content-Length: 166
Content-Type: application/vnd.geo+json; charset=UTF-8
Date: Wed, 30 Jul 2014 09:37:12 GMT
Server: waitress
{
"features": [
{
"id": "0af6caa9b345473d81f68d23e8aff214",
"properties": {
"item": "work on daybed",
"status": "done"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
http GET http://localhost:8000/models/todo/records --json
HTTP/1.1 200 OK
Content-Length: 101
Content-Type: application/json; charset=UTF-8
Date: Wed, 30 Jul 2014 09:37:23 GMT
Server: waitress
{
"records": [
{
"id": "0af6caa9b345473d81f68d23e8aff214",
"item": "work on daybed",
"status": "done"
}
]
}
Actually it is a random fix :s
Bug can be observed here with backbone-daybed : http://spiral-project.github.io/backbone-daybed/#todo
Accept
header is application/json, text/javascript, */*; q=0.01
Rather problematic :/
By default, the geojson renderer is used even when it doesn't make sense. We shouldn't do that.