SpringDoc: Unable to preview Request & Response Beans (Models) on Swagger UI

Viewed 98

Hi Team,

I have configured SpringDoc OpenAPI Swagger in one of my Spring Boot projects.

The Swagger-UI opens up fine, however, whenever I click to preview the models (request and response structure) on any of the endpoints displayed on Swagger UI, I get errors like could not resolve reference to components (screenshot added below for reference.)

I rechecked the api-docs for Swagger (/v3/api-docs), all the component schemas were properly generated and were present in the docs.

Swagger Components - Unable to Resolve Reference Error

Also, when I performed the above click operation on Swagger UI, multiple errors were displayed in the application stack trace like "Conflicting setter definitions..." that are related to Jackson. However, the conflicting beans are not defined anywhere by me in the project so probably these are getting instantiated internally through some other libraries but I am not sure which exact library is causing these conflicts for SpringDoc. (Screenshot added below for reference.)

Jackson - Conflicting Setter Definition Error

I have cleaned up the project, removed duplicated/conflicting dependencies, tried every possible solution, but still, this error persists.

Below are the details of dependency versions which I am using for Spring Boot and Spring Doc.

Spring Boot: Version 2.5.5

SpringDoc OpenAPI UI: Version 1.5.11

Can anyone suggest any solution to this issue? It would be really helpful.

0 Answers
Related