spring-attic / tut-react-and-spring-data-rest

React.js and Spring Data REST :: A tutorial based on the 5-part blog series by Greg Turnquist
https://spring.io/guides/tutorials/react-and-spring-data-rest
882 stars 1.57k forks source link

HAL is not working #100

Closed ghost closed 5 years ago

ghost commented 5 years ago

When I try to access the url localhost:8080/api/employees/ it shows a different json than the tutorial { "_embedded" : { "employees" : [ { "_links" : { "self" : { "href" : "http://localhost:8080/api/employees/1" }, "employee" : { "href" : "http://localhost:8080/api/employees/1" } } } ] }, "_links" : { "self" : { "href" : "http://localhost:8080/api/employees" }, "profile" : { "href" : "http://localhost:8080/api/profile/employees" } } }

looks like the Employee object is not being retrieved

I just downloaded the code and ran the springboot main java file

ghost commented 5 years ago

the problem is related to lombok when I remove lombok and place the getters and setters then it works as suposed

gregturn commented 5 years ago

Depends upon how you're running it.

From the command? Then maven will properly build everything.

From your IDE? Probably need the Lombok plugin.

gregturn commented 5 years ago

As of https://github.com/spring-guides/tut-react-and-spring-data-rest/commit/e5965d3e680f0b5eb8effac6721005126374c749, I have delomboked the code. See if it works for you now.