无法执行从扬鞭UI和Thorntail休息方法

问题描述 投票:0回答:1

我注意到,建设使用JAX-RS和扬鞭UI依赖性的Thorntail REST应用程序时,通过扬鞭UI产生的REST调用使用https,而不是http。下面是我使用的REST服务:

@Path("/time")
@Api(value = "/time", description = "Get the time", tags = "time")
@Produces(MediaType.APPLICATION_JSON)
public class HelloWorldEndpoint {

    @GET
    @Path("/now")
    @ApiOperation(value = "Get the current time",
            notes = "Returns the time as a string",
            response = String.class
    )
    @Produces(MediaType.APPLICATION_JSON)
    public String get() {
        return String.format("{\"value\" : \"The time is %s\"}", new Date());
    }
}

而依赖关系:

<dependency>
  <groupId>io.thorntail</groupId>
  <artifactId>swagger</artifactId>
</dependency>
 <dependency>
  <groupId>io.thorntail</groupId>
  <artifactId>jaxrs</artifactId>
</dependency>
<dependency>
  <groupId>io.thorntail</groupId>
  <artifactId>swagger-webapp</artifactId>
</dependency>

在这种情况下,所产生的REST调用是:

curl -X GET "https://localhost:8080/time/now" -H  "accept: application/json"

返回:

curl: (35) SSL received a record that exceeded the maximum permissible length.

有势力利用“HTTP”,而不是“https”时,任何参数(@Api?)?

swagger-ui thorntail
1个回答
0
投票

在我身边,我用在项目defaults.yml这个配置

thorntail:
  deployment:
    my-webapp.war:
      swagger:
        schemes:
          - http
© www.soinside.com 2019 - 2024. All rights reserved.