I have a simple controller that return a User object, this user have a attribute coordinates that have the hibernate property FetchType.LAZY.
When I try to get this
In the case of Spring Data Rest then, while the solution posted by @r1ckr works, all that is required is to add one of the following dependencies depending on your Hibernate version:
com.fasterxml.jackson.datatype
jackson-datatype-hibernate4
${jackson.version}
or
com.fasterxml.jackson.datatype
jackson-datatype-hibernate5
${jackson.version}
Within Spring Data Rest there is a class:
org.springframework.data.rest.webmvc.json.Jackson2DatatypeHelper
which will auto-detect and register the Module on application start-up.
There is however an issue:
Issue Serializing Lazy @ManyToOne