简体   繁体   中英

CXF REST APIs Documentation using Swagger

According to Swagger's tutorial, seems swagger only support Jersey framework (See https://github.com/wordnik/swagger-core/wiki/java-jax-rs )

Does anybody have experience on making swagger work with CXF JAX-RS implementation? Could you share your suggestions here?

Yes, it is possible to use Swagger with CXF JAX-RS implementation using swagger-jaxrs_2.10 module.

Using Swagger in CXF environment require some specific configuration that can be done via Spring application context.

Here is a good tutorial and example of such configuration.

Yes, It is possible to use swagger with Apache CXF. Below is the swagger usage in my working API.

@GET
    @Path("/version")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "For paged fetches returns a version for future fetches")
    public long version(@Context HttpHeaders headers) {
        return ABC.version();
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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