tedwhy 发表于 2017-12-25 10:23:37

swagger 在apache CXF 中的使用——JAX-RS Swagger2Feature

The CXF Swagger2Feature allows you to generate Swagger 2.0 documents from JAX-RS service endpoints with a simple configuration.  见:http://cxf.apache.org/docs/swagger2feature.html
  JAX-RS Swagger2Feature
Demo  
=================
  

  
The demo shows a basic usage of Swagger 2.0 API documentation with REST based Web Services using
  
JAX-RS 2.0 (JSR-339). Swagger UI is available at: http://localhost:9000/
  

  
Building and running the demo using Maven
  
---------------------------------------
  

  
From the base directory of this sample (i.e., where this README file is
  
located), the Maven pom.xml file can be used to build and run the demo.
  

  

  
Using either UNIX or Windows:
  

  mvn install
  mvn -Pserver(from one command line window)
  

  
After the service is started, the Swagger API documents in JSON and YAML
  
are available at
  

  http://localhost:9000/swagger.json
  http://localhost:9000/swagger.yaml
  

  

  
To view the Swagger document using Swagger-UI, use your Browser to
  
open the Swagger-UI page at
  

  http://localhost:9000/api-docs?url=/swagger.json
  

  
or
  

  http://localhost:9000/api-docs?url=/swagger.yaml
  

  
or access it from the CXF Services page:
  

  http://localhost:9000/services
  and follow a Swagger link.
页: [1]
查看完整版本: swagger 在apache CXF 中的使用——JAX-RS Swagger2Feature