Springdoc endpoints doesn't show up

760 views Asked by At

Hello I have built a project in Thymleaf and wanted to generate the API documentation with swagger. But for some reason I can't explain, only endpoints annotated with @Rquestboy are documented. Does anyone have any idea where this might be?

enter image description here

enter image description here

enter image description here

1

There are 1 answers

0
Sniphs On BEST ANSWER

I have solved the problem by using a different dependency

Gradle:

// springfox
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'

// springfox-swagger-ui
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '3.0.0'
implementation group: 'io.springfox', name: 'springfox-bean-validators', version: '3.0.0'

ConfigClass:

@Configuration
@Import(BeanValidatorPluginsConfiguration.class)
public class SwaggerConfig {

    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.basePackage("Class.Path.to.the.Controler"))
                .build();
    }
}

You have to change the class path to the path to your endpoints !!