Skip to content
Advertisement

Swagger OpenAPI 3.0 – Springdoc – GroupedOpenApi not working in Spring MVC

My Application is Sping MVC not boot.

I’m using springdoc-openapi-ui 1.4.4

also, I added the following imports to one of my @configuration class;

JavaScript

and implement the beans as below

JavaScript

But when I try http://localhost:8080/MyApp/v3/api-docs/user

gives me 404.

but I get all the APIs listed in http://localhost:8080/MyApp/v3/api-docs

Also it comes in http://www.onlykalu.com:81/MyApp/swagger-ui/index.html?configUrl=/MyApp/v3/api-docs/swagger-config

also without definition drop down.

if I add

JavaScript

to application.properties then I get

enter image description here

What I’m doing wrong?

Do I need to import any other class to get group functionality work?

Thanks

Advertisement

Answer

Your question has been also answered here:

As mentioned, you just had to put your Beans definition inside a dedicated configuration class, and add it to the springdoc-openapi Beans imports, so that the same mechanism loads the Beans.

This is the correct beans configuration:

JavaScript

And the springdoc-openapi imports together with the GroupsConfiguration :

JavaScript
Advertisement