Home » Java » java – In a RESTful/REST service is better expose the entity like it is or using a DTO or VO?-Exceptionshub

java – In a RESTful/REST service is better expose the entity like it is or using a DTO or VO?-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I’ll expose a RESTful service and i have some doubts if is a good practice expose entity or the better is using DTO(Data Transfer Object) or VO(Value Object) or another way.

The doubt is about the sensible business information and auto generate documentation with Swagger when use JPA with bi-directional mapping the schemas behave like dropdown infinite recursive.

How do you do yours restful services?

How to&Answers: