HATEOAS client with AngularJS
Checkout angular-hateoas. ITs an AngularJS module for using $resource with a HATEOAS-enabled REST API.
Checkout angular-hateoas. ITs an AngularJS module for using $resource with a HATEOAS-enabled REST API.
Using the syntax described in the current draft of the URI template spec you would do: /users{?surname,maxresults}
I restarted this topic on the API-Craft google group and got some great responses. The main advantages of the Array design are: multiple links for the same relationship multiple relationships for the same link without writing the link aggain the ability to order the links The map of cause has better accessibility. As far as … Read more
@JohnDoDo One first question: Does the media type define the contract between my server and client? Yes, media type is one part of the contract. Contract in REST API is not static unlike SOAP(i.e. WSDL). Contract is defined by combination of underlying protocol(i.e. HTTP), URIs and Media Types(it’s not prohibited to use several media types … Read more
Please don’t dismiss HAL so quickly just because it looks a little bloated (in its JSON form, it’s quite minimal). HAL is to JSON what HTML is to plain text. It adds hyperlinks. You need hyperlinks and a commonly understood representation format (such as HAL or Collection+JSON) for REST. You also need HATEOAS for REST, … Read more
There’s neither a REST nor a HATEOAS specification. Both are only concepts, or architectural styles, if you will. _embedded is part of the HAL format. It’s intended to embed (sic!) resources where otherwise only their URIs would be returned. For example GET http://localhost:8080/mywebservice/features is supposed to only return a list of URIs, like http://localhost:8080/mywebservice/features/GROUND, and … Read more
Spring HATEOAS provides common abstractions (representational models, a Link class, API to build links pointing to Spring MVC controllers, etc.) to ease building hypermedia driven REST APIs with Spring MVC in general. Thus, you can use it alongside Spring MVC to manually build those services. Spring Data REST uses Spring HATEOAS to automatically expose resources … Read more
There’s a lot of confusion about this, because most applications that call themselves REST don’t use hypermedia and aren’t REST at all. Hypermedia is a generalization of hypertext for content other than HTML. You can say hypertext is a subset of hypermedia. Hypermedia can be HTML in a browser, with all links, buttons and everything … Read more
The Serializer Bundle alone might not be enough for this situation as it is only concerned with serialization and deserialization, not more complex semantical tasks. I would suggest looking into FSCHateoasBundle to implement a pretty hypermedia format for your API.
That is a great question. If you look at the example for Hal you will see that the rels are defined within the context of the sub-resource. I do not know of any definitive guide on when the rel is related to the resource as a whole or a contained sub resource. The only extra … Read more