To do real Hypermedia APIs, we should be exposing all the resource related actions to the user. This is only true for that particular resource. It should not expose other resources. So in this case, say you have a resource for Person entity in your system. Assuming you have the necessary implementations, I'd expect following routes or similar to be exposed:
GET /person/{id} personController.fetch
POST /person personController.create
PUT /person/{id} personController.update
DELETE /person/{id} personController.delete
And, theoretically speaking, when you get the resource in XML:
<person>
<id>123</id>
<name>john</name>
<lastname>doe</lastname>
<links>
<link rel="create" ref="/person" method="POST" />
<link rel="delete" ref="/person/123" method="DELETE" />
<link rel="update" ref="/person/123" method="PUT" />
</links>
</person>
and in JSON:
{
"id": 123,
"name": "john",
"lastname": "doe",
{"rel": "create", "ref": "/person", "method": "POST"},
{"rel": "delete", "ref": "/person/123", "method": "DELETE"},
{"rel": "create", "ref": "/person/123", "method": "PUT"},
]
}
Now clients can implement relying on the logic created based on these links rather than hardcoding these links into the client application. It'd be really nice to see this in the springmvc-router too.. I can implement some logic and check in if you want... I just didn't go too deep into the source code yet..
Or if you do so, I'd appreciate that ;)
Cheers,
Isa