Recently Ive seen so many devs working with the stack Spring/JPA and returning all these JPA entities on their rest controllers.
In my opinion it's a BAD PRACTICE for several reason such: Transactions (should never start on the REST controllers), sensible informations can be exposed by mistake, maintenance of the entities is hard since it's easy to break the rest interface, also many others.
If you have the view representation like DTO's, makes your life easier.
I would like to understand why, or if really are advantages of using this approach.