fix: replace default object mapper due to the serilisation of Json views (#28484)
This commit is contained in:
parent
8643a5f284
commit
1983fbe174
|
|
@ -21,6 +21,7 @@ import com.appsmith.server.solutions.ReleaseNotesService;
|
|||
import com.appsmith.util.WebClientUtils;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
|
@ -343,8 +344,13 @@ public class ApplicationTemplateServiceCEImpl implements ApplicationTemplateServ
|
|||
String authHeader = "Authorization";
|
||||
String payload;
|
||||
try {
|
||||
ObjectWriter ow = objectMapper.writer().withDefaultPrettyPrinter();
|
||||
payload = ow.writeValueAsString(communityTemplate);
|
||||
// Please don't use the default ObjectMapper.
|
||||
// The default mapper is registered with views.public.class and removes few attributes due to this
|
||||
// The templates flow has different requirement hence not using the same
|
||||
ObjectMapper ow = new ObjectMapper();
|
||||
ow.registerModule(new JavaTimeModule());
|
||||
ObjectWriter writer = ow.writer().withDefaultPrettyPrinter();
|
||||
payload = writer.writeValueAsString(communityTemplate);
|
||||
} catch (Exception e) {
|
||||
return Mono.error(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user