diff --git a/problem-spring-web/README.md b/problem-spring-web/README.md index 66444dad..997f1c69 100644 --- a/problem-spring-web/README.md +++ b/problem-spring-web/README.md @@ -31,7 +31,7 @@ If you're not using Spring Boot, add the following dependency to your project: ## Configuration -If not using the starter module, make sure you register the required modules with your ObjectMapper: +If not using the starter module, make sure you register the required Jackson Modules with your ObjectMapper: ```java @Bean @@ -45,6 +45,18 @@ public ConstraintViolationProblemModule constraintViolationProblemModule() { } ``` +If using the starter module, but disabling Spring Boot AutoConfiguration, you could easily import the `ProblemJacksonAutoConfiguration` class. +For example, this is necessary when writing tests and use `@WebMvcTest` instead of `@SpringBootTest`: + +```java +@WebMvcTest +@ContextConfiguration(classes = ...) +@Import(ProblemJacksonAutoConfiguration.class) +class MyTest { + // ... +} +``` + The following table shows all built-in advice traits: | Advice Trait | Produces |