I am consuming an external/third party api and I have created an endpoint in my SpringBoot application that currently returns its response via Spring REST API (RestTemplate). My ultimate goal is to re-structure the response and to do so I created both entity and a new Dto with the expected format.
I am not really sure when it comes to the right approach to convert the existing third party api response to a custom one. Can you advise on it? Shall I write a dto to dto converter? Is there any example I can follow? Would such conversion be part of a service? Any advice is much appreciated.
Thank you