CanalTP/navitia — pull request #667 by antoine-de (2014-10-28 14:28:45+00:00)
Title: Prev next fix

some list param were missing in links

small refactoring of the links

this refactoring should be more complete, but we cannot do this before
the v2 and some thought about the internal link handling

links example:
api endpoint
```json
"versions": [
{
"description": "Current version of the api",
"links": [
{
"href": "http://localhost:5000/v1/",
"rel": "api",
"templated": false,
"type": "api"
}
],
"status": "current",
"value": "v1"
}
]
```

call on 'v1'
```json
{

"links": [
{
"description": "Coverage of navitia",
"href": "http://localhost:5000/v1/coverage/",
"rel": "coverage",
"templated": false,
"type": "coverage"
},
{
"description": "Inverted geocoding for a given coordinate",
"href": "http://localhost:5000/v1/coord/0.0%3B0.0",
"rel": "coord",
"templated": true,
"type": "coord"
},
{
"description": "Compute journeys",
"href": "http://localhost:5000/v1/journeys",
"rel": "journeys",
"templated": false,
"type": "journeys"
}
]

}
```

some links on journeys:

```json
links": [
{
"href": "http://localhost:5000/v1/journeys?to=poi%3ATAOGen861&min_nb_journeys=3&from=stop_area%3ASCF%3ASA%3ASAOCE87543009&datetime_represents=arrival&datetime=20141030T153116",
"rel": "prev",
"templated": false,
"type": "prev"
},
{
"href": "http://localhost:5000/v1/coverage/stop_points/{stop_point.id}?collection=stop_points",
"rel": "stop_points",
"templated": true,
"type": "stop_point"
},
```
Note: for the 'next' links the type should be 'journeys' but since it was 'next' before we cannot change that before the v2 :cry: