OpenAPI failure

Hello Jmix team,

I’m trying to generate OpenAPI 3.0 specification using springdoc-openapi-ui dependency as described here https://www.baeldung.com/spring-rest-openapi-documentation

I created a brand new project and installed the REST API addon.

Unfortunately after I add the dependency
implementation ‘org.springdoc:springdoc-openapi-ui:1.6.4’
I start getting circular dependencies and application does not run.

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2022-01-10 15:36:36.646 ERROR 17356 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The dependencies of some of the beans in the application context form a cycle:

???->???
| io.jmix.security.SecurityConfiguration (field private org.springframework.security.core.session.SessionRegistry io.jmix.security.SecurityConfiguration.sessionRegistry)
???<-???

Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

Is Jmix compatible with this library?

Hi,
We’ve created an issue for this error.
Also, keep in mind that REST API add-on provides endpoints that return generic and project specific OpenAPI documentation. So if your goal is to have documentation for “standard” REST API endpoints, you may use it.

Hi, thanks for your reply.

My goal is to be able to have documentation for both generic and my custom endpoints at the same place.

Basically I want to hit endpoint like /v3/api-docs and get the OpenApi specification ready to be used in Swagger or any other tool.