hateoas - Non-contextual operations using REST and HATEOS -
i trying implement hateos based rest service hotel booking have confusion:
1) how apart wadl, client comes know possible operations , corresponding uri. should put possible operations , uri response when client hits root of rest service?
2) when client gets list of accommodation options in area, returning list of hotels in area asked about. response contains:
<accommodation> <hotel info="http://welco.me/hotel/xxxxxx" price="5000"/> <hotel info="http://welco.me/hotel/yyyyyyy" price="3000"/> </accommodation>
but query have here how client going know other related possible operations getting list in sorted order of price?
- in answer first question, there couple of specs documents allow clients discover restful apis.
- swagger
- json home
- google use own discovery service, unlike swagger , json home, unfortunately don't think there open sourced libraries use expose own apis.
- for second questions again, tend towards clients/developers discovering parameters such sorting swagger/json home document. if super strong/important relationship return in responses linked data:
Comments
Post a Comment