winery
winery copied to clipboard
[FR] Winery Responses should contain links
Every response of the REST API should(/must) return links to subresources etc.
For example:
A GET on http://localhost:8089/winery/servicetemplates/
returns the following JSON:
[
{
"id": "MyTinyToDo-MySql_OpenStack-w1-wip1",
"name": "MyTinyToDo-MySql_OpenStack-w1-wip1",
"namespace": "http://opentosca.org/servicetemplates",
"qName": "{http://opentosca.org/servicetemplates}MyTinyToDo-MySql_OpenStack-w1-wip1"
}
]
So now to get to the example Service Template the user must somehow magically guess how to get there, which is basically a GET to the URL:
http://localhost:8089/winery/servicetemplates/http%3A%2F%2Fopentosca.org%2Fservicetemplates/MyTinyToDo-MySql_OpenStack-w1-wip1
That this is a bit weird from a design perspective, it would be quite nice if the response would look something like this:
[
{
"id": "MyTinyToDo-MySql_OpenStack-w1-wip1",
"name": "MyTinyToDo-MySql_OpenStack-w1-wip1",
"namespace": "http://opentosca.org/servicetemplates",
"qName": "{http://opentosca.org/servicetemplates}MyTinyToDo-MySql_OpenStack-w1-wip1",
"_link" : {
"href" : "http://localhost:8089/winery/servicetemplates/http%3A%2F%2Fopentosca.org%2Fservicetemplates/MyTinyToDo-MySql_OpenStack-w1-wip1",
"type" : "self"
}
}
]
Atleast with the _link
object in the response people could navigate the API based on the responses, which would make the API a bit RESTy.
P.S.: Just whoever may have time to do this, don't forget the application/xml support :)