package de.mlessmann.certassist.config; import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.v3.core.jackson.ModelResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Configuration for Springdoc OpenAPI to respect Jackson annotations. * This ensures that only properties that are visible to Jackson (annotated with @JsonProperty) * are included in the OpenAPI schema. */ @Configuration public class SpringdocConfiguration { /** * Creates a ModelResolver that uses the same ObjectMapper as the application. * This ensures that Springdoc respects the same visibility settings as Jackson. * * @param objectMapper the configured ObjectMapper from JacksonConfiguration * @return a ModelResolver that uses the application's ObjectMapper */ @Bean public ModelResolver modelResolver(ObjectMapper objectMapper) { return new ModelResolver(objectMapper); } }