I was using Spring boot springBootVersion = '2.1.9.RELEASE' and need at a project to migrate to springBootVersion = '2.3.3.RELEASE'. In this project we use spring data rest and also have some controllers returning database entities as EntityModel/Resource.
Before the upgrade what is serialized from the controller (and returned as as Resource) does not contain the entity id or the entity version. Similar to spring data rest interface.
After upgrade, spring data rest interface continues to not return the id or the version, which is correct/expected but in the controller, the EntityModel\ is serialized/returned along with the id/version json properties. I could not find the reason or any reference of it in trhe documentation. Is this a bug or is intended? Can this becaviour somehow be adapted vis project configuration to remain as it was with spring boot 2.1.9.RELEASE?
I have create a sample/small project with 2 unit tests.
In commit Sample project with Spling boot 2.1.9, the id and version in both controller and spring data rest are not exposed and both unit test com.example.demo.DemoApplicationTests#payloads and com.example.demo.DemoApplicationTests#dataRestPayloads pass.
In commit Spring boot 2.3.3, the unit test com.example.demo.DemoApplicationTests#payloads fails because id appears in the json body of the response.
If this is not the correct place for tracking this issue, please guide me accordingly.
arongas opened DATAREST-1558 and commented
I was using Spring boot springBootVersion = '2.1.9.RELEASE' and need at a project to migrate to springBootVersion = '2.3.3.RELEASE'. In this project we use spring data rest and also have some controllers returning database entities as EntityModel/Resource.
Before the upgrade what is serialized from the controller (and returned as as Resource) does not contain the entity id or the entity version. Similar to spring data rest interface.
After upgrade, spring data rest interface continues to not return the id or the version, which is correct/expected but in the controller, the EntityModel\ is serialized/returned along with the id/version json properties. I could not find the reason or any reference of it in trhe documentation. Is this a bug or is intended? Can this becaviour somehow be adapted vis project configuration to remain as it was with spring boot 2.1.9.RELEASE?
I have create a sample/small project with 2 unit tests.
In commit Sample project with Spling boot 2.1.9, the id and version in both controller and spring data rest are not exposed and both unit test com.example.demo.DemoApplicationTests#payloads and com.example.demo.DemoApplicationTests#dataRestPayloads pass.
In commit Spring boot 2.3.3, the unit test com.example.demo.DemoApplicationTests#payloads fails because id appears in the json body of the response.
If this is not the correct place for tracking this issue, please guide me accordingly.
Affects: 3.3.3 (Neumann SR3)
Reference URL: https://github.com/arongas/payload