Skip to content

Commit

Permalink
[MERGE/#162] 코틀린 컨버터 제거 방식 변경
Browse files Browse the repository at this point in the history
[REFACTOR/#162] 코틀린 컨버터 제거 방식 변경
  • Loading branch information
ckkim817 authored Nov 12, 2024
2 parents c94b2e9 + 459fe3a commit 38ad81b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dependencies {
// Redisson
implementation "org.redisson:redisson:3.29.0"

// SWAGER
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0'

// EMAIL
Expand Down
16 changes: 4 additions & 12 deletions src/main/java/org/sopt/seonyakServer/global/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import java.util.List;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.converter.json.KotlinSerializationJsonHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

Expand All @@ -22,16 +21,9 @@ public void addCorsMappings(CorsRegistry registry) {
.maxAge(3600);
}

// 애플리케이션의 HTTP 메시지 컨버터를 완전히 새로 설정
// 외부 라이브러리의 코틀린 컨버터를 제거
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
// 기존 컨버터들을 모두 제거 (외부 라이브러리의 코틀린 컨버터와 충돌을 피하기 위함)
converters.clear();

// Swagger M7 ByteArrayHttpMessageConverter (add
converters.add(new ByteArrayHttpMessageConverter());

// Jackson 라이브러리를 사용하는 컨버터 추가
converters.add(new MappingJackson2HttpMessageConverter());
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.removeIf(KotlinSerializationJsonHttpMessageConverter.class::isInstance);
}
}

0 comments on commit 38ad81b

Please sign in to comment.