title: Proper way to map ObjectId to String in DTO in Spring
body: <p>I am working with Spring WebSocket. I have this DTO of the <code>Message</code></p>
  <pre><code>@AllArgsConstructor
  @Data
  public class MessageDto {
  
      private ObjectId messageId;
      private ObjectId chatId;
  }
  </code></pre>
  <p>When I send this DTO as response, <code>ObjectId</code> fields in DTO maps like this:</p>
  <p><a href="https://i.stack.imgur.com/kXlIJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kXlIJ.png" alt="enter image description here" /></a></p>
  <p>How can I map <code>ObjectId</code> field into <code>String</code> like <code>62790c02513ad11442eec6d7</code>?</p>