I'm having some serious trouble seeing how HATEOAS and Microservices can co-exist.
Let's take an example:
Let's say we have a shopping cart resource. And we need to put snapshots of products into it, e.g. product Id, product price; snapshot of current price when item was added to cart, and possibly some other values. The actual use-case is not relevant, but just to get some idea on the problem at hand.
When I have been doing HATEOAS earlier, I would have put a link in the shopping cart resource that links to products or a template url that links to a specific product.
This way, the client can still be ignorant of resource URL's.
But in the microservice world, a service should have no knowledge of other services. AFAIK.
So how could they both work together?
My interpretation of microservices is that they can never link to anything else than themselves, which would pretty much be a Self
link.
I've found the same question asked on ther places, e.g. https://groups.google.com/forum/#!topic/api-craft/YRkLFVY_zFc
Where solutions like "macro services" that weave all this together is used. Which doesn't seem like a clean way to solve things.
[Edit]
I've found some more nice info on the topic: https://github.com/Netflix/eureka https://github.com/RestExpress/HyperExpress
This seems nice to have some tool augument the resources with links, but this makes me think, where does the logic to decide what links a resource should have belongs? In the service that exposes the resource? In the central service registry?