Skip to content

Commit

Permalink
Removed registering JavaTimeModule implicitly according to issue fix …
Browse files Browse the repository at this point in the history
…in latest swagger-request-validator
  • Loading branch information
wlodarcp committed Aug 25, 2021
1 parent f2d5d35 commit 421630b
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import io.swagger.util.Json;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
Expand All @@ -13,14 +11,7 @@ public class BeanFactory {

@Bean
ObjectMapper objectMapper(Jackson2ObjectMapperBuilder mapperBuilder) {
JavaTimeModule javaTimeModule = new JavaTimeModule();

//According to issue https://bitbucket.org/atlassian/swagger-request-validator/issues/331/timestamp-iso8601-format-issue
Json.mapper().registerModule(javaTimeModule);

ObjectMapper objectMapper = mapperBuilder
.modules(javaTimeModule)
.build();
ObjectMapper objectMapper = mapperBuilder.build();

objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
return objectMapper;
Expand Down

0 comments on commit 421630b

Please sign in to comment.