I have a usecase where any changes in one environment (prod,stg,qa,dev) needs to be reflected in remaining environments. I thought of connecting my application to different environments but later decided to make api calls to the service of that environment and get,update data. (For example from prod environment I call the dev endpoint and that gives data from dev db). For making http calls I am using feignClients. My issue is if I query directly from db I get the object as org.bson.Document. But when making http calls as I didn’t have predefine data, I didn’t create POJO. So I am getting data as LinkedHashMap. Every nested Object is becoming LinkedHashmap. Is there any best practice to handle these cases and my code look cleaner. As dealing with LinkedHashMap for nested object may make my code not look great.
Thanks in advance.
I tried using ObjectMapper to convert the response to Document. But the nested objects are still LinkedHashMaps. I am also eager to know any other language other than java solve this problem more simply.