Spring Not sending all fields in JSON response
By default, Spring Data Rest no longer marshalls @Id Properties to JSON.
This can be achieved using expose Ids - Please check Spring Rest
Similar post here with detailed explanation- id not marshalled to JSON
I would suggest to have Intermediate Response Class instead of converting Entity to JSON.