Swagger无法应用于接口

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

我们在类似的接口上分离了REST定义:

    public inteface Bitacora { ... }

然后实现去:

    public class BitacoraResource implements Bitacora { ... }

经过大量的测试,我们看到Swagger仅在定义是类而不是接口的情况下才起作用。

是否有一种解决方法可以使Swagger使用接口而不是类?

@Provider
@Path("/bitacora")
@Api(value = "/bitacora", description = "API")
public class Bitacora {

    @GET
    @Produces({MediaType.TEXT_XML,MediaType.APPLICATION_JSON})
    @Wrapped(element="bitacora")
    @GZIP
    @ApiOperation(value = "obtiene info",notes = "obtiene info bitacora",consumes="*/*",produces= "*/*")
    @ApiResponses(value = { @ApiResponse(code = 200, message = "ok"),@ApiResponse(code = 400, message = "sinlistar"), @ApiResponse(code = 404, message = "error") })
    public Collection<Favorito> listar(@HeaderParam("data") String data) {
        return null;
    }
}
java rest jakarta-ee resteasy swagger
1个回答
0
投票
有关详细信息,请参考my answer其他问题。
© www.soinside.com 2019 - 2024. All rights reserved.