繁体   English   中英

如何将Swagger与Maven + Jersey + jboss EAP 6.2集成

[英]How to integrate Swagger with Maven + Jersey+ jboss EAP 6.2

我已经为jboss7.2完成了jersey REST服务的代码。 以下是我带有大胆注释的REST。 但是我无法为示例Rest Service生成swagger文档。任何人都可以帮助我使用swagger逐步详细过程来生成Rest文档

    @Api(value="Employee" ,description="manage Emnployee")
@Path("/employee")
public class TestServices {
    @Path("/get/{id}")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value="List all people", notes="List all people using paging")
    public Response getEmployee(@PathParam("id") String empId){
        System.out.println("Employee ID : "+empId);
        Empolyee emp= new Empolyee(empId, "SAnjay");
        return Response.status(200).entity(emp).build();
    }

我对swagger-core servlet感到很幸运,并将swagger-ui指向映射此servlet的位置。

对于Jersey 2.X,请参见: https : //github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup#hooking-up-swagger-core-in-your -应用

或者参见: https : //github.com/swagger-api/swagger-core/wiki/Java-JAXRS-Quickstart

要生成静态文档,您需要使用maven-plugin https://github.com/kongchen/swagger-maven-plugin

我从来没有碰过运气...而且我知道需要静态文档生成

我使用带有Maven的https://github.com/teamcarma/swagger-jaxrs-doclet生成静态Swagger-UI文件

另外,该项目为基于JAX-RS注释和JavaDoc的swagger-ui生成文件,因此无需Swagger注释

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM