Skip to content

Instantly share code, notes, and snippets.

@wpik
Created September 20, 2019 09:40
Show Gist options
  • Save wpik/701e44a8177331a69575a01a0daa2f28 to your computer and use it in GitHub Desktop.
Save wpik/701e44a8177331a69575a01a0daa2f28 to your computer and use it in GitHub Desktop.
Spring tips
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
@Configuration
public class ObjectMapperConfig {
@Bean
public Jackson2ObjectMapperBuilder jacksonBuilder() {
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
builder.failOnUnknownProperties(true);
return builder;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment