Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
use default message converters. only override jackson msg converter
Browse files Browse the repository at this point in the history
  • Loading branch information
ubhaller committed Nov 11, 2021
1 parent eefac48 commit 58844dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@Configuration
@ComponentScan(
Expand All @@ -24,7 +23,6 @@
"ch.admin.bag.covidcertificate.rest"
})
@EnableAutoConfiguration
@EnableWebMvc
public class VerificationCheckWS {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.module.kotlin.KotlinModule;
import java.time.Instant;
import java.util.List;
import java.util.Collections;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public abstract class WsBaseConfig implements WebMvcConfigurer {
public abstract class WsBaseConfig {

@Override
public void configureMessageConverters(final List<HttpMessageConverter<?>> converters) {
converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
WebMvcConfigurer.super.configureMessageConverters(converters);
@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
MappingJackson2HttpMessageConverter jacksonConverter =
new MappingJackson2HttpMessageConverter(objectMapper());
jacksonConverter.setSupportedMediaTypes(
Collections.singletonList(MediaType.APPLICATION_JSON));
return jacksonConverter;
}

@Bean
Expand Down

0 comments on commit 58844dd

Please sign in to comment.