commit ab0488870bfc080c45c4821d7363eb1ce33b2c50
parent 73579a1427a3a48adee74b6a861e4e79af4beecb
Author: Wim Dupont <wim@wimdupont.com>
Date: Sun, 17 Dec 2023 17:59:25 +0100
swagger objectmapper fix
Former-commit-id: d2a16fb242057ebd664ff9ec79389dd433cd9f18
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/wimdupont/personalweb/config/RssConfig.java b/src/main/java/com/wimdupont/personalweb/config/RssConfig.java
@@ -1,13 +1,22 @@
package com.wimdupont.personalweb.config;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
@Configuration
public class RssConfig {
@Bean
+ @Primary
+ //Required for swagger when XmlMapper bean is defined
+ public ObjectMapper objectMapper() {
+ return new ObjectMapper();
+ }
+
+ @Bean
public XmlMapper xmlMapper() {
return new XmlMapper();
}