generated from semicolondsm/Semicolon_Repository_Generator
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: webClient codec을 SNAKE_CASE로 수정
- Loading branch information
1 parent
51002ea
commit 794b869
Showing
1 changed file
with
13 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 13 additions & 2 deletions
15
...rc/main/kotlin/com/xquare/v1userservice/configuration/webclient/WebClientConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
package com.xquare.v1userservice.configuration.webclient | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.http.codec.ClientCodecConfigurer | ||
import org.springframework.http.codec.json.Jackson2JsonDecoder | ||
import org.springframework.web.reactive.function.client.ExchangeStrategies | ||
import org.springframework.web.reactive.function.client.WebClient | ||
|
||
|
||
@Configuration | ||
class WebClientConfiguration { | ||
@Bean | ||
fun webClient(): WebClient = | ||
WebClient.builder().build() | ||
fun webClient(objectMapper: ObjectMapper): WebClient = | ||
WebClient.builder() | ||
.exchangeStrategies(ExchangeStrategies.builder() | ||
.codecs { configurer: ClientCodecConfigurer -> | ||
configurer.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(objectMapper)) | ||
} | ||
.build()) | ||
.build() | ||
} |