小编chr*_*s14的帖子

如何安排Docket的groupName在Swagger UI中显示的顺序

我在一个 Spring Boot 应用程序中设置两个不同的 Docket API。我给了一个 Docket“Test”groupName 并保留另一个,因此它最终在 Swagger UI 中成为“默认”。

我的问题是,如何在 UI 中排列这些 Dockets 的顺序。

起初我以为是按字母顺序排列的,但事实并非如此。我不断地改变名字,但顺序未知。

    @Bean
    public Docket myAPI(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.basePackage("anything"))
            .paths(PathSelectors.regex("/v1/anything.*"))
            .build()
            .apiInfo(apiInfo());
        buildGlobalParameter(docket);
        buildGlobalResponseMessage(docket);
        return docket;
    }

    @Bean
    public Docket testAPI(){
        Docket tDocket = new Docket(DocumentationType.SWAGGER_2)
            .groupName("Test Card")
            .select()
            .apis(RequestHandlerSelectors.basePackage("anything"))
            .paths(PathSelectors.regex("/v1/anything2*"))
            .build()
            .apiInfo(apiTestInfo());
        buildGlobalParameter(tDocket);
        buildGlobalResponseMessage(tDocket);
        return tDocket;
    }

Run Code Online (Sandbox Code Playgroud)

https://i.stack.imgur.com/bAmNm.jpg

抱歉,我还不能发布图片,所以我留下直接的 URL。

当我运行 spring boot 应用程序时,我希望默认的 Swagger UI 显示为“默认”UI。

java swagger-ui spring-boot swagger-2.0 springfox

5
推荐指数
1
解决办法
2941
查看次数

:generateGitProperties git 子模块在 Heroku 中构建失败

我的项目由我在 Github 上公开推送的子模块组成。但我的主要存储库是私有存储库。我想将我的 Springboot 应用程序部署到 Heroku。我尝试按照Heroku 的步骤进行操作。

当我推送并部署到 Heroku 时,发生了错误。

remote:        > Task :generateGitProperties FAILED
remote:
remote:        FAILURE: Build failed with an exception.
remote:
remote:        * What went wrong:
remote:        Execution failed for task ':generateGitProperties'.
remote:        > No .git directory found!
Run Code Online (Sandbox Code Playgroud)

在heroku上如何解决这个问题?

编辑:我尝试先删除子模块,但仍然发现 git 目录未找到问题。

github heroku spring-boot

4
推荐指数
1
解决办法
6224
查看次数

标签 统计

spring-boot ×2

github ×1

heroku ×1

java ×1

springfox ×1

swagger-2.0 ×1

swagger-ui ×1