【问题标题】:Swagger requesting credentials non of them is accepted大摇大摆地请求非他们的凭据被接受
【发布时间】:2018-07-30 21:27:22
【问题描述】:

我收到了这个弹出窗口,http://localhost:8080/swagger-ui.html。 首先,我认为这是我的数据库或 GIT 的密码。 但是,不接受上述任何一项。

package com.gabor.usermanagment.configs;


    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import springfox.documentation.builders.RequestHandlerSelectors;
    import springfox.documentation.service.ApiInfo;
    import springfox.documentation.service.Contact;
    import springfox.documentation.spi.DocumentationType;
    import springfox.documentation.spring.web.plugins.Docket;
    import springfox.documentation.swagger2.annotations.EnableSwagger2;
    import static springfox.documentation.builders.PathSelectors.regex;

    @Configuration
    @EnableSwagger2
    public class SwaggerConfig {                                    
          @Bean
            public Docket productApi() {
                return new Docket(DocumentationType.SWAGGER_2)
                        .select()
                        .apis(RequestHandlerSelectors.basePackage("com.gabor.usermanagment.api"))
                        .paths(regex("/customerapi.*"))
                        .build()
                        .apiInfo(metaData());
            }
            private ApiInfo metaData() {
                ApiInfo apiInfo = new ApiInfo(
                        "Spring Boot REST API",
                        "Spring Boot REST API for Online Store",
                        "1.0",
                        "Terms of service",
                        new Contact("John Thompson", "https://springframework.guru/about/", "john@springfrmework.guru"),
                       "Apache License Version 2.0",
                        "https://www.apache.org/licenses/LICENSE-2.0");
                return apiInfo;
            }
        }

【问题讨论】:

    标签: eclipse swagger


    【解决方案1】:

    What is username and password when starting Spring Boot with Tomcat?

    在进一步了解解决方案之后,我找到了它。此问题已解决。

    【讨论】:

      猜你喜欢
      • 2022-06-17
      • 2022-11-07
      • 2019-05-11
      • 1970-01-01
      • 2022-09-28
      • 1970-01-01
      • 2017-10-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多