spring-projects / spring-hateoas-examples

Collection of examples on how (and why) to build hypermedia-driven apps with Spring HATEOAS
Apache License 2.0
384 stars 186 forks source link

Example to showcase how to create a relationship between resources #23

Open sbley opened 5 years ago

sbley commented 5 years ago

The existing hypermedia example provides an overview on related resources (Employee, Manager), how to link them and evolve api.

In addition to that, I would like to see example code on how to create relationships and how to provide hypermedia links for that. Especially when it comes to many-to-many relationships.

Imagine the Employee works in different Projects, so these two resources are many-to-many.

How do we add hypermedia links to create these relationships and how are these POST/PUT requests modeled in the controllers? I would be grateful to see this in a spring-hateoas-example.

nmwael commented 4 years ago

Id be very interested in seeing cross service affordances between related resources.. For example how do you show that an employee can use the "resign" affordance on a specified project?

Right now im doing this by links but does not seem to be the correct way since links does not specify http method (put post etc) but affordances do, but does not support the relation text.