<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dto on Devops Monk</title><link>https://devops-monk.com/tags/dto/</link><description>Recent content in Dto on Devops Monk</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 03 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://devops-monk.com/tags/dto/index.xml" rel="self" type="application/rss+xml"/><item><title>DTOs and Response Shaping</title><link>https://devops-monk.com/tutorials/spring-boot/spring-boot-dto-response/</link><pubDate>Sun, 03 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/spring-boot/spring-boot-dto-response/</guid><description>Every beginner makes the same mistake: returning JPA entities directly from REST controllers. This article explains why that&amp;rsquo;s dangerous, and how to design clean DTOs that make your API stable, secure, and maintainable.
Why Not Return Entities Directly? Consider this:
@GetMapping(&amp;#34;/{id}&amp;#34;) public Order getOrder(@PathVariable UUID id) { return orderRepository.findById(id).orElseThrow(); // Entity returned directly } Problems with this:
1. Serialization of lazy-loaded relationships crashes
@Entity public class Order { @OneToMany(fetch = FetchType.</description></item></channel></rss>