Intro

According to the API spec of project, we can have multiple forms of DTOs for Request and Response. So we can get multiple DTO files, which can be visibly messy to manage.

Is there a way to combine all forms of DTOs into one file for better management? Yes, through static nested class!

Note on nested class

Take a look at My posted on nested class before continuing.

DTOs via static nested class

This reference explained well on how to arrange DTOs.