jax
jax

Reputation: 38583

Expose @Service methods as Rest endpoints using spring-data-rest

I using spring-data-rest in conjunction to spring-data-jpa which exposes all my spring-data-jpa interfaces as REST resources in HAL JSON format.

I would like to expose my @Service methods in the same fashion. Is this possible? If not, what is the best way to implement an endpoint that may need to use more complex logic the JSON response?

Upvotes: 1

Views: 947

Answers (1)

franDayz
franDayz

Reputation: 943

I think you should take a look at this post:

Spring HATEOAS versus Spring Data Rest

Basically the answer says that if you want to expose a REST service which implies some logic more complex than CRUD, there's no other way but implementing the REST layer yourself.

Upvotes: 2

Related Questions