Problem/Motivation
When adding a Rest export on ie http://drupal.d8/admin/structure/views/view/frontpage the generated response when visiting the configured URL say http://drupal.d8/api/rest/nodes it should note return an array with each item being a HAL response object.
[ <======== wrong
{
"_links": {
"self": {
"href": "http://drupal.d8/node/2"
},
"type": {
"href": "http://drupal.d8/rest/type/node/article"
},
}
You can check this with https://github.com/mikekelly/hal-browser and attached orders.json.txt
The hal browser nicely presents the order.json document but chokes on the views output.
Proposed resolution
Follow the example http://tools.ietf.org/html/draft-kelly-json-hal-06#section-6
- pagers should be added to _links
- _embed should contain the list of nodes
Another page to check for is on http://haltalk.herokuapp.com/explorer/browser.html#/users
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| orders.json_.txt | 868 bytes | clemens.tolboom |
Comments
Comment #1
clemens.tolboomAnother example page is http://haltalk.herokuapp.com/explorer/browser.html#/users
Comment #2
dawehner#2100637: REST views: add special handling for collections will solve that.
Comment #3
clemens.tolboom