diff --git a/hb-file/src/main/java/com/ruoyi/file/config/onlyoffice/OnlyofficeConfiguration.java b/hb-file/src/main/java/com/ruoyi/file/config/onlyoffice/OnlyofficeConfiguration.java index 2e55a55..a49cdd7 100644 --- a/hb-file/src/main/java/com/ruoyi/file/config/onlyoffice/OnlyofficeConfiguration.java +++ b/hb-file/src/main/java/com/ruoyi/file/config/onlyoffice/OnlyofficeConfiguration.java @@ -18,6 +18,7 @@ package com.ruoyi.file.config.onlyoffice; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.file.office.documentserver.storage.FileStoragePathBuilder; import com.ruoyi.file.office.documentserver.util.SSLUtils; @@ -28,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import javax.annotation.PostConstruct; @@ -78,8 +80,15 @@ public class OnlyofficeConfiguration { } } +// @Bean +// public ObjectMapper objectMapper(){ // create the object mapper +// return new ObjectMapper(); +// } + @Bean - public ObjectMapper objectMapper(){ // create the object mapper - return new ObjectMapper(); + public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) { + ObjectMapper mapper = builder.createXmlMapper(false).build(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + return mapper; } }