部署到Cloud Foundry时jHipster招摇过市的UI路径问题
我已经为CloudFoundry部署了注册表、网关和微服务。微服务在注册表中可用,并且已在网关中成功注册 尝试在Swagger UI中调用调用时,Swagger生成的url如下所示:部署到Cloud Foundry时jHipster招摇过市的UI路径问题,jhipster,swagger-ui,cloud-foundry,jhipster-registry,Jhipster,Swagger Ui,Cloud Foundry,Jhipster Registry,我已经为CloudFoundry部署了注册表、网关和微服务。微服务在注册表中可用,并且已在网关中成功注册 尝试在Swagger UI中调用调用时,Swagger生成的url如下所示: https://<microservice_route_with_port>/api/service_name/api/action_name 在将微服务部署到PCF时,Swagger如何在没有端口的情况下指向网关url?(我已经使用jHipster cloudfoundry subgenerator
https://<microservice_route_with_port>/api/service_name/api/action_name
谢谢 通过指定主机名,暂时解决了该问题:
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.host(GATEWAY_ROUTE_WITHOUT_PORT) //Add
.apiInfo(apiInfo)
.forCodeGeneration(true)
.genericModelSubstitutes(ResponseEntity.class)
.select()
.paths(regex(DEFAULT_INCLUDE_PATTERN))
.build();
通过指定主机名,暂时解决了此问题:
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.host(GATEWAY_ROUTE_WITHOUT_PORT) //Add
.apiInfo(apiInfo)
.forCodeGeneration(true)
.genericModelSubstitutes(ResponseEntity.class)
.select()
.paths(regex(DEFAULT_INCLUDE_PATTERN))
.build();
您在何处进行此更改?@freemanpolys我在jHipster创建的自动生成的SwaggerConfiguration.java文件中进行了此更改。您在何处进行此更改?@freemanpolys我在jHipster创建的自动生成的SwaggerConfiguration.java文件中进行了此更改。
eureka:
instance:
prefer-ip-address: false
hostname: ${vcap.application.uris[0]}
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.host(GATEWAY_ROUTE_WITHOUT_PORT) //Add
.apiInfo(apiInfo)
.forCodeGeneration(true)
.genericModelSubstitutes(ResponseEntity.class)
.select()
.paths(regex(DEFAULT_INCLUDE_PATTERN))
.build();