Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
53.2. JBoss Fuse CXF Implementations
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
This section describes how to use the SwaggerFeature in JBoss Fuse CXF implementations, in which REST services are defined inside JAR files and deployed to a JBoss Fuse container or a fabric8 container.
Your JBoss 6.2.1 installation contains a Quickstart (installDir
/quickstarts/cxf/rest/
) that demonstrates how to create a RESTful (JAX-RS) web service using CXF and how to enable Swagger and annotate the JAX-RS endpoints.
Enabling Swagger 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Enabling Swagger involves:
- Modifying the XML file that defines the CXF service by adding the CXF class (
io.fabric8.cxf.endpoint.SwaggerFeature
) to the<jaxrs:server>
definition.For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the REST resource class:
- Importing the Swagger API annotations for each annotation required by the service:
import com.wordnik.swagger.annotations.Api*
where * = Api, ApiOperation, ApiParam, ApiResponse, ApiResponses, and so on.For details, see https://github.com/swagger-api/swagger-core/wiki/Annotations. - Adding Swagger annotations to the JAX-RS annotated endpoints (@PATH, @PUT, @POST, @GET, @Produces, @Consumes, @DELETE, @PathParam, and so on).For an example, see Example 53.2, “Example REST resource with Swagger annotations”.
Building and Deploying the Rest quickstart 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
See the README file in your JBoss Fuse 6.2.1 installDir
/quickstarts/cxf/rest/
directory for instructions on how to build and deploy the rest quickstart.