package com.codebyte.api.config;

import org.openapitools.jackson.nullable.JsonNullableModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/** Jackson customizations. */
@Configuration
public class JacksonConfig {

    /**
     * Enables (de)serialization of {@link org.openapitools.jackson.nullable.JsonNullable}, which
     * lets PATCH DTOs distinguish an absent field from one explicitly set to {@code null}.
     */
    @Bean
    JsonNullableModule jsonNullableModule() {
        return new JsonNullableModule();
    }
}
