如何从GET方法中剔除身体?

时间:2017-05-01 17:33:09

标签: java spring-boot swagger jersey-2.0

我在Spring-boot上使用了带泽西的招摇。我的API如下所示:

@Component
@Api
@Path("/")
@Produces("application/json")
public class MyApi {
    @GET
    @Path("/items/{id}")
    @ApiOperation(value = "Get item by id")
    public Item getItem(
            @ApiParam(value = "the item id", required = true)
            @PathParam("id") String id) throws Exception {
        // ...
    }
}

当我浏览Swagger UI时,我发现此方法下有一个body参数。我怎么能摆脱它? GET方法不应该有body参数。我不能在Swagger UI中尝试这种方法。

我使用的是swagger-jersey2-jaxrs 1.5.0

谢谢!

0 个答案:

没有答案