I\'m working in a Spring Boot project, as my implement at the moment, almost for each API I have request and response classes.
For example:
I will suggest you to use JSON format instead of creating class and returning its instance every time. But still if you need a class hierarchy you can create a class and put a variable which will store JSON.