I have this Spring Java class
@Entity
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String firstName;
private String lastName;
//getters and setters here
}
which outputs me following response
{
"_embedded" : {
"people" : [ {
"firstName" : "John",
"lastName" : "Dean",
"_links" : {
"self" : {
"href" : "http://localhost:8060/people/1"
},
"person" : {
"href" : "http://localhost:8060/people/1"
}
}
},
But I want to see also the id to be to exposed, how to do that?
This didn't help How to expose the resourceId with Spring Data Rest