Describe the bug
Starting with 3.1.0, any endpoint with an Integer/int query parameter carrying a Bean Validation constraint (e.g. @Min) causes a WARN log on every api-docs request:
Json Processing Exception occurred: Cannot construct instance of java.util.HashSet (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('integer')
at [Source: ...]; line: 1, column: 9] (through reference chain: io.swagger.v3.oas.models.media.JsonSchema["type"])
It also occurs with array-typed schemas (ArraySchema["type"], value 'array'). On a real API with many endpoints this produces dozens of these warnings per api-docs request.
To Reproduce
- Spring Boot 4.1.0
springdoc-openapi-starter-webmvc-ui 3.1.0
I wrote a minimal Spring Boot app and a test that calls GET /v3/api-docs and asserts no SpringDocUtils WARN is logged. I ran it myself against both versions to confirm the regression:
@RestController
class HelloController {
@GetMapping("/hello")
String hello(@RequestParam(required = false) @Min(1) Integer limit) {
return "hello";
}
}
@SpringBootTest
@AutoConfigureMockMvc
class ApiDocsWarningTest {
@Autowired
MockMvc mockMvc;
ListAppender<ILoggingEvent> appender;
@BeforeEach
void attachAppender() {
appender = new ListAppender<>();
appender.start();
((Logger) LoggerFactory.getLogger("org.springdoc.core.utils.SpringDocUtils"))
.addAppender(appender);
}
@Test
void apiDocsRequestLogsNoJsonProcessingWarning() throws Exception {
mockMvc.perform(get("/v3/api-docs"))
.andExpect(status().isOk());
List<String> warnMessages = appender.list.stream()
.filter(e -> e.getLevel() == Level.WARN)
.map(ILoggingEvent::getFormattedMessage)
.toList();
assertThat(warnMessages)
.noneMatch(m -> m.contains("Json Processing Exception occurred"));
}
}
- With springdoc-openapi-starter-webmvc-ui:3.0.3 → test passes, no warning.
- With springdoc-openapi-starter-webmvc-ui:3.1.0, everything else unchanged → test fails, SpringDocUtils logs the Json Processing Exception occurred warning shown above.
Expected behavior
No warning should be logged when generating the OpenAPI docs for this endpoint.
Additional context
- Response is still 200 OK with an apparently valid spec, so functionally nothing is visibly broken — it's just log noise.
- Bisected against every version between 3.0.1 and 3.1.0 published on Maven Central (no releases exist between 3.0.3 and 3.1.0, it's a direct jump). 3.0.1, 3.0.2, 3.0.3 are all clean; 3.1.0 is the first version to show this.
Describe the bug
Starting with 3.1.0, any endpoint with an
Integer/intquery parameter carrying a Bean Validation constraint (e.g.@Min) causes a WARN log on every api-docs request:Json Processing Exception occurred: Cannot construct instance of java.util.HashSet (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('integer')
at [Source: ...]; line: 1, column: 9] (through reference chain: io.swagger.v3.oas.models.media.JsonSchema["type"])
It also occurs with
array-typed schemas (ArraySchema["type"], value'array'). On a real API with many endpoints this produces dozens of these warnings per api-docs request.To Reproduce
springdoc-openapi-starter-webmvc-ui3.1.0I wrote a minimal Spring Boot app and a test that calls
GET /v3/api-docsand asserts noSpringDocUtilsWARN is logged. I ran it myself against both versions to confirm the regression:Expected behavior
No warning should be logged when generating the OpenAPI docs for this endpoint.
Additional context