Created
June 3, 2020 22:12
-
-
Save hkakutalua/482ff215afa951fc69645686cf1783b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.example.partialupdates.config; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.openapitools.jackson.nullable.JsonNullableModule; | |
import org.springframework.context.annotation.Configuration; | |
import javax.annotation.PostConstruct; | |
@Configuration | |
public class JacksonConfiguration { | |
private final ObjectMapper objectMapper; | |
public JacksonConfiguration(ObjectMapper objectMapper) { | |
this.objectMapper = objectMapper; | |
} | |
@PostConstruct | |
ObjectMapper jacksonObjectMapper() { | |
objectMapper.registerModule(new JsonNullableModule()); | |
return objectMapper; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment