feat(config): add jackson-databind-nullable for JsonNullable PATCH DTO support
Registers JsonNullableModule globally so JsonNullable<String> in JourneyItemUpdateDTO can distinguish absent (unchanged) from explicit null (clear field) on PATCH operations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -253,6 +253,13 @@
|
|||||||
<version>1.18.1</version>
|
<version>1.18.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JsonNullable<T> for PATCH DTOs: distinguishes absent (unchanged) from explicit null (clear) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
|
<version>0.2.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Observability: Prometheus metrics scrape endpoint (version managed by Spring Boot BOM) -->
|
<!-- Observability: Prometheus metrics scrape endpoint (version managed by Spring Boot BOM) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.micrometer</groupId>
|
<groupId>io.micrometer</groupId>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.raddatz.familienarchiv.config;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.openapitools.jackson.nullable.JsonNullableModule;
|
||||||
|
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JacksonConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Jackson2ObjectMapperBuilderCustomizer jsonNullableModule() {
|
||||||
|
return builder -> builder.modulesToInstall(new JsonNullableModule());
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user