我在一个 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。
我的项目由我在 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 目录未找到问题。