-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
I would like to see some example, where I can use HATEOAS approach for creating rest api services on some real objects. Is this approach good way?
I mean something like this:
@Data
public class Invoice {
// ... some fields/attributes and other things
public Receipt claimPaid(PaymentInfo paymentInfo) {
// ....
}
public boolean isCancellable() {
// .... Return if invoice can be canceled (from business point of view)
}
public void cancel() {
// .... Actually cancel invoice and possibly delete it
}
}
I would like to see relations in rest api resource for "claimPaid" method (always) and for "cancel" method, if applicable.
Is hateoas usable (without much coding) in a such way?
I know that using spring-data there is extremely easy to have HAL working on entities (no controller class is needed for example. Just entity and "empty" repository interface with RepositoryRestResource annotation).
Please provide some "real life" example in repository, or at least some info how we should use it in such application.
Metadata
Metadata
Assignees
Labels
No labels