You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2015/12/22 15:47:44 UTC
svn commit: r976159 - in /websites/production/cxf/content:
cache/docs.pageCache docs/swaggerfeature-swagger2feature.html
Author: buildbot
Date: Tue Dec 22 14:47:44 2015
New Revision: 976159
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/swaggerfeature-swagger2feature.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/swaggerfeature-swagger2feature.html
==============================================================================
--- websites/production/cxf/content/docs/swaggerfeature-swagger2feature.html (original)
+++ websites/production/cxf/content/docs/swaggerfeature-swagger2feature.html Tue Dec 22 14:47:44 2015
@@ -118,12 +118,12 @@ Apache CXF -- SwaggerFeature / Swagger2F
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><h1 id="SwaggerFeature/Swagger2Feature-SwaggerFeature/Swagger2Feature">SwaggerFeature / Swagger2Feature</h1><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1442832427934 {padding: 0px;}
-div.rbtoc1442832427934 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1442832427934 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1450795621127 {padding: 0px;}
+div.rbtoc1450795621127 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1450795621127 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1442832427934">
-<ul class="toc-indentation"><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-SwaggerFeature/Swagger2Feature">SwaggerFeature / Swagger2Feature</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-Properties">Properties</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringProgramatically">Configuring Programatically</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringinSpring">Configuring in Spring</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringinBlueprint">Configuring in Blueprint</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-Samples">Samples</a></li></ul>
+/*]]>*/</style></p><div class="toc-macro rbtoc1450795621127">
+<ul class="toc-indentation"><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-SwaggerFeature/Swagger2Feature">SwaggerFeature / Swagger2Feature</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-Properties">Properties</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringProgramatically">Configuring Programatically</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringinSpring">Configuring in Spring</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringinBlueprint">Configuring in Blueprint</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-ConfiguringinCXFNonSpringJaxrsServlet">Configuring in CXFNonSpringJaxrsServlet</a></li><li><a shape="rect" href="#SwaggerFeature/Swagger2Feature-Samples">Samples</a></li></ul>
</div><p> </p><p>The CXF Swagger2Feature allows you to generate <a shape="rect" class="external-link" href="http://swagger.io/specification/" rel="nofollow">Swagger 2.0</a> documents from JAX-RS service endpoints with a simple configuration.</p><p>For generating <a shape="rect" class="external-link" href="https://github.com/swagger-api/swagger-spec/blob/master/versions/1.2.md" rel="nofollow">Swagger 1.2</a> documents, you can use SwaggerFeature instead of Swagger2Feature.</p><p>These features can be configured programatically in Java or using Spring or Blueprint beans.</p><h1 id="SwaggerFeature/Swagger2Feature-Properties">Properties</h1><p><span style="line-height: 1.4285715;">The following optional parameters can be configured in Swagger2Feature</span></p><p><span style="line-height: 1.4285715;">Note some properties listed below are not available or used differently in SwaggerFeature, as the corresponding properties are used differently in Swagger 2.0 and Swagger 1.2
. Please refer to the corresponding Swagger documentation for more information.)</span></p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Name</th><th colspan="1" rowspan="1" class="confluenceTh">Description</th><th colspan="1" rowspan="1" class="confluenceTh">Default</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">basePath</td><td colspan="1" rowspan="1" class="confluenceTd">the context root path<sup>+</sup></td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">contact</td><td colspan="1" rowspan="1" class="confluenceTd">the contact information<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">"users@cxf.apache.org"</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">description</td><td colspan="1" rowspan="1" class="confluenceTd">the description<span>+</span></td><td colspan="1" rowspan="1" class="confluenceT
d">"The Application"</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">filterClass</td><td colspan="1" rowspan="1" class="confluenceTd">a security filter<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">host</td><td colspan="1" rowspan="1" class="confluenceTd">the host and port<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">ignoreRoutes</td><td colspan="1" rowspan="1" class="confluenceTd">excludes specific paths when scanning all resources (see scanAllResources)<span>+</span><span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">license</td><td colspan="1" rowspan="1" class="confluenceTd">the license<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">"Apache 2.0 License"</td></tr><tr><td colspan="1" rowspan=
"1" class="confluenceTd">licenceUrl</td><td colspan="1" rowspan="1" class="confluenceTd">the license URL<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">"<span class="nolink">http://www.apache.org/licenses/LICENSE-2.0.html</span>"</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">prettyPrint</td><td colspan="1" rowspan="1" class="confluenceTd">when generating swagger.json, pretty-print the json document<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">false</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">resourcePackage</td><td colspan="1" rowspan="1" class="confluenceTd">a list of comma separated package names where resources must be scanned<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">a list of service classes configured at the endpoint</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">runAsFilter</td><td colspan="1" rowspan="1" class="confluenceTd">runs the feature as a filter</td><td
colspan="1" rowspan="1" class="confluenceTd">false</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">scan</td><td colspan="1" rowspan="1" class="confluenceTd">generates the swagger documentation<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">true</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">scanAllResources</td><td colspan="1" rowspan="1" class="confluenceTd">scans all resources including non-annotated JAX-RS resources<span>+</span><span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">false</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">schemes</td><td colspan="1" rowspan="1" class="confluenceTd">the protocol schemes<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">termsOfServiceUrl</td><td colspan="1" rowspan="1" class="confluenceTd">the terms of service URL<span>+</span></td><td colspan="1" rowspan="1" class="confluence
Td">null</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">title</td><td colspan="1" rowspan="1" class="confluenceTd">the title<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">"Sample REST Application"</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">version</td><td colspan="1" rowspan="1" class="confluenceTd">the version<span>+</span></td><td colspan="1" rowspan="1" class="confluenceTd">"1.0.0"</td></tr></tbody></table></div><p>Note: those descriptions marked with <span>+ correspond to the properties defined in Swagger's BeanConfig, and those marked with <span>+</span><span>+ correspond to the properties defined in Swagger's ReaderConfig.</span></span></p><h1 id="SwaggerFeature/Swagger2Feature-ConfiguringProgramatically">Configuring Programatically</h1><p> </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
@@ -208,6 +208,40 @@ import org.apache.cxf.jaxrs.swagger.Swag
</jaxrs:server>
</blueprint>
 </pre>
+</div></div><h1 id="SwaggerFeature/Swagger2Feature-ConfiguringinCXFNonSpringJaxrsServlet">Configuring in CXFNonSpringJaxrsServlet</h1><p> </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><web-app>
+ <context-param>
+ <param-name>contextParam</param-name>
+ <param-value>contextParamValue</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>CXFServlet</servlet-name>
+ <display-name>CXF Servlet</display-name>
+ <servlet-class>
+ org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet
+ </servlet-class>
+ <init-param>
+ <param-name>jaxrs.serviceClasses</param-name>
+ <param-value>
+ org.apache.cxf.systest.jaxrs.BookStore
+ </param-value>
+ </init-param>
+ <init-param>
+ <param-name>jaxrs.features</param-name>
+ <param-value>
+ org.apache.cxf.jaxrs.swagger.Swagger2Feature
+ (basePath=/somepath)
+ </param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CXFServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app></pre>
</div></div><h1 id="SwaggerFeature/Swagger2Feature-Samples">Samples</h1><p><span>CXF's distribution contains the following samples.</span></p><ul><li><a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_swagger" rel="nofollow">samples/jax_rs/description_swagger</a>: Swagger 1.2 sample using SwaggerFeature programatically</li><li><a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_swagger2" rel="nofollow">samples/jax_rs/description_swagger2</a>: Swagger 2.0 sample using Swagger2Feature programatically</li><li><a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_swagger2_web" rel="nofollow">samples/jax_rs/description_swagger2_web</a>: Swagger 2.0 web application sample using Swagger2Feature using Spring</li><
li><a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_swagger2_osgi" rel="nofollow">samples/jax_rs/description_swagger2_osgi</a>: Swagger 2.0 OSGi application sample using Swagger2Feature using Blueprint<br clear="none"><br clear="none"></li></ul><p> </p></div>
</div>
<!-- Content -->