Search code examples
swagger-uispringdoc-openapi-uispringdoc-ui

Springdoc endpoints doesn't show up


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


Solution

  • 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 !!