cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1037492 - in /websites/production/cxf/content: cache/docs.pageCache docs/openapifeature.html
Date Sun, 02 Dec 2018 17:57:33 GMT
Author: buildbot
Date: Sun Dec  2 17:57:32 2018
New Revision: 1037492

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/openapifeature.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/openapifeature.html
==============================================================================
--- websites/production/cxf/content/docs/openapifeature.html (original)
+++ websites/production/cxf/content/docs/openapifeature.html Sun Dec  2 17:57:32 2018
@@ -119,24 +119,24 @@ Apache CXF -- OpenApiFeature
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1539219573706 {padding: 0px;}
-div.rbtoc1539219573706 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1539219573706 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1543773415480 {padding: 0px;}
+div.rbtoc1543773415480 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1543773415480 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1539219573706">
-<ul class="toc-indentation"><li><a shape="rect" href="#OpenApiFeature-Introduction">Introduction</a></li><li><a
shape="rect" href="#OpenApiFeature-Setup">Setup</a></li><li><a shape="rect"
href="#OpenApiFeature-Properties">Properties</a></li><li><a shape="rect"
href="#OpenApiFeature-ConfiguringfromCode">Configuring from Code</a></li><li><a
shape="rect" href="#OpenApiFeature-ConfiguringfromSpring">Configuring from Spring</a></li><li><a
shape="rect" href="#OpenApiFeature-ConfiguringinBlueprint">Configuring in Blueprint</a></li><li><a
shape="rect" href="#OpenApiFeature-ConfiguringinCXFNonSpringJaxrsServlet">Configuring in
CXFNonSpringJaxrsServlet</a></li><li><a shape="rect" href="#OpenApiFeature-ConfiguringfromPropertyfiles">Configuring
from Property files</a></li><li><a shape="rect" href="#OpenApiFeature-SpringBootAutoConfiguration">Spring
Boot Auto Configuration</a></li><li><a shape="rect" href="#OpenApiFeature-EnablingSwaggerUI">Enabling
Swagger UI</a></li><li><a shape="rect" href="#
 OpenApiFeature-ConfiguringSwaggerUI(3.2.7+)">Configuring Swagger UI (3.2.7+)</a></li><li><a
shape="rect" href="#OpenApiFeature-Samples">Samples</a></li></ul>
+/*]]>*/</style></p><div class="toc-macro rbtoc1543773415480">
+<ul class="toc-indentation"><li><a shape="rect" href="#OpenApiFeature-Introduction">Introduction</a></li><li><a
shape="rect" href="#OpenApiFeature-Setup">Setup</a></li><li><a shape="rect"
href="#OpenApiFeature-Properties">Properties</a></li><li><a shape="rect"
href="#OpenApiFeature-ConfiguringfromCode">Configuring from Code</a></li><li><a
shape="rect" href="#OpenApiFeature-ConfiguringfromSpring">Configuring from Spring</a></li><li><a
shape="rect" href="#OpenApiFeature-ConfiguringinBlueprint">Configuring in Blueprint</a></li><li><a
shape="rect" href="#OpenApiFeature-ConfiguringinCXFNonSpringJaxrsServlet">Configuring in
CXFNonSpringJaxrsServlet</a></li><li><a shape="rect" href="#OpenApiFeature-ConfiguringfromPropertyfiles">Configuring
from Property files</a></li><li><a shape="rect" href="#OpenApiFeature-SpringBootAutoConfiguration">Spring
Boot Auto Configuration</a></li><li><a shape="rect" href="#OpenApiFeature-EnablingSwaggerUI">Enabling
Swagger UI</a></li><li><a shape="rect" href="#
 OpenApiFeature-ConfiguringSwaggerUI(3.2.7+)">Configuring Swagger UI (3.2.7+)</a></li><li><a
shape="rect" href="#OpenApiFeature-OpenApiFeature-UsingMultipleServerEndpoints(3.3.0+)UsingMultipleServerEndpoints(3.3.0+)">Using
Multiple Server Endpoints (3.3.0+)</a></li><li><a shape="rect" href="#OpenApiFeature-Samples">Samples</a></li></ul>
 </div><h2 id="OpenApiFeature-Introduction">Introduction</h2><p>The
CXF <strong>OpenApiFeature</strong> allows you to generate <a shape="rect"
class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> documents from JAX-RS service endpoints with a simple
configuration. This feature can be configured programmatically in Java or using Spring or
Blueprint beans.</p><h2 id="OpenApiFeature-Setup">Setup</h2><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">&lt;dependency&gt;
     &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
     &lt;artifactId&gt;cxf-rt-rs-service-description-openapi-v3&lt;/artifactId&gt;
     &lt;version&gt;3.2.4&lt;/version&gt;
 &lt;/dependency&gt;</pre>
-</div></div><p>The&#160;<strong>cxf-rt-rs-service-description-openapi-v3</strong>
is only available in <strong>3.2.x</strong> and above due to Java 8 baseline.
For older releases, as well as for the users of older Swagger specifications 1.x/2.x, there
is a dedicated converter provided: <span class="confluence-link"><a shape="rect"
href="https://cwiki.apache.org/confluence/display/CXF20DOC/Swagger2Feature">org.apache.cxf.jaxrs.swagger.openapi.SwaggerToOpenApiConversionFilte</a>r</span>.</p><h2
id="OpenApiFeature-Properties">Properties</h2><p><span>The following
optional parameters can be configured in <strong>OpenApiFeature</strong>. Note
that although there are some similarities with Swagger specifications 1.x/2.x, <a shape="rect"
class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> is a significant revamp of the specification (in
a good sense of it).</span></p><div class="table-wrap"><table class="wrapped
confl
 uenceTable"><colgroup span="1"><col span="1"><col span="1"><col span="1"><col
span="1"><col span="1"></colgroup><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 value (if applicable)</th><th
colspan="1" rowspan="1" class="confluenceTh">Sample value (if applicable)</th><th
colspan="1" rowspan="1" class="confluenceTh">&#160;</th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">configLocation</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>the OpenAPI configuration location</p></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">/config/openapi-configuration.yml</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">scanKnownConfigLocations</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>scan known
  OpenAPI configuration location (classpath or filesystem), which are:</p><div class="preformatted
panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+</div></div><p>The&#160;<strong>cxf-rt-rs-service-description-openapi-v3</strong>
is only available in <strong>3.2.x</strong> and above due to Java 8 baseline.
For older releases, as well as for the users of older Swagger specifications 1.x/2.x, there
is a dedicated converter provided: <span class="confluence-link"><a shape="rect"
href="https://cwiki.apache.org/confluence/display/CXF20DOC/Swagger2Feature">org.apache.cxf.jaxrs.swagger.openapi.SwaggerToOpenApiConversionFilte</a>r</span>.</p><h2
id="OpenApiFeature-Properties">Properties</h2><p><span>The following
optional parameters can be configured in <strong>OpenApiFeature</strong>. Note
that although there are some similarities with Swagger specifications 1.x/2.x, <a shape="rect"
class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> is a significant revamp of the specification (in
a good sense of it).</span></p><div class="table-wrap"><table class="wrapped
confl
 uenceTable"><colgroup span="1"><col span="1" style="width: 236.0px;"><col
span="1" style="width: 511.0px;"><col span="1" style="width: 203.0px;"><col span="1"
style="width: 372.0px;"></colgroup><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 value (if applicable)</th><th
colspan="1" rowspan="1" class="confluenceTh">Sample value (if applicable)</th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">configLocation</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>the OpenAPI configuration location</p></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">/config/openapi-configuration.yml</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">scanKnownConfigLocations</td><td
colspan="1" rowspan="1" class="confluenceTd"><p>scan known OpenAPI configuration
location (class
 path or filesystem), which are:</p><div class="preformatted panel" style="border-width:
1px;"><div class="preformattedContent panelContent">
 <pre>openapi-configuration.yaml
 openapi-configuration.json
 openapi.yaml
 openapi.json</pre>
-</div></div></td><td colspan="1" rowspan="1" class="confluenceTd">true</td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">propertiesLocation</td><td colspan="1" rowspan="1" class="confluenceTd">the
properties file location</td><td colspan="1" rowspan="1" class="confluenceTd">/swagger.properties</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;/swagger.properties</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">securityDefinitions</td><td colspan="1"
rowspan="1" class="confluenceTd">a list of security definitions<strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>["basicAuth" -&gt; new SecurityScheme().type(Type.HTTP))]</p></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr>
 <td colspan="1" rowspan="1" class="confluenceTd">customizer</td><td colspan="1"
rowspan="1" class="confluenceTd">the customizer class instance</td><td colspan="1"
rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">new
OpenApiCustomizer()</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">swaggerUiMavenGroupAndArtifact</td><td
colspan="1" rowspan="1" class="confluenceTd">the Maven artifacts to pinpoint SwaggerUI</td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"org.webjars.swagger-ui'</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">swaggerUiVersion</td><td colspan="1" rowspan="1" class="confluenceTd">the
version of SwaggerUI</td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td
colspan="1" rowspan="1" class="confluenceTd">"3.13.0
 "</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">supportSwaggerUi</td><td colspan="1"
rowspan="1" class="confluenceTd">turns on/off SwaggerUI support</td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>null (== true)</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">filterClass</td><td colspan="1" rowspan="1" class="confluenceTd">a
security filter<strong>*</strong><strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"com.example.filter.SampleFilter"</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">resourceClasses</td><td colspan="1" rowspan="1" class="confluenceTd">a
list of resource classes which must be scanned<str
 ong>*</strong><strong>*</strong></td><td colspan="1" rowspan="1"
class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">["com.example.rest.SampleResource"]</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">resourcePackages</td><td colspan="1"
rowspan="1" class="confluenceTd">a list of package names where resources must be scanned<strong>*</strong><strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">["com.example.rest"]</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">ignoredRoutes</td><td colspan="1"
rowspan="1" class="confluenceTd">excludes specific paths when scanning all resources (see
scanAllResources)<span><strong>*</strong><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1
 " class="confluenceTd">["/api/test"]</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">prettyPrint</td><td colspan="1" rowspan="1"
class="confluenceTd">when generating openapi.json, pretty-print the JSON document<span><strong>*</strong><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>true</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</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"><strong>false</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">scan</td><td colspan="1" rowspan="1" class="confluenceTd"
 >Scan all JAX-RS resources automatically</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>true</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">readAllResources</td><td colspan="1" rowspan="1" class="confluenceTd"><span>Read
all operations also with no @Operation<strong>*</strong><strong>*</strong></span><span>&#160;</span></td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>true</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</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><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">null</td><td colspan="1" r
 owspan="1" class="confluenceTd">&#160;</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">licenseUrl</td><td colspan="1" rowspan="1" class="confluenceTd">the
license URL<strong>*</strong></td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td
colspan="1" rowspan="1" class="confluenceTd">"<span class="nolink"><a shape="rect"
class="external-link" href="http://www.apache.org/licenses/LICENSE-2.0.html">http://www.apache.org/licenses/LICENSE-2.0.html</a></span>"</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">license</td><td colspan="1" rowspan="1"
class="confluenceTd">the license<span><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"Apache 2.0 License"</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">contactUrl</td><td colspan="1" r
 owspan="1" class="confluenceTd">the contact link<strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">contactEmail</td><td colspan="1"
rowspan="1" class="confluenceTd">the contact email<strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"users@<a shape="rect" href="http://cxf.apache.org">cxf.apache.org</a>"</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">contactName</td><td colspan="1" rowspan="1"
class="confluenceTd">the contact name<strong>*</strong></td><td colspan="1"
rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr>
 <tr><td colspan="1" rowspan="1" class="confluenceTd">description</td><td
colspan="1" rowspan="1" class="confluenceTd">the description<span><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"The Sample REST Application with OpenAPI integration"</td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">title</td><td colspan="1" rowspan="1"
class="confluenceTd">the title<span><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"Sample REST Application"</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">version</td><td colspan="1" rowspan="1" class="confluenceTd">the
version<span><strong>*</strong></span></td><td colspan="1"
rowspan="1" class="confluenceTd">null</td><td colspan="1" row
 span="1" class="confluenceTd">"1.0.0"</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><span class="blob-code-inner blob-code-marker-addition">swaggerUiConfig</span></td><td
colspan="1" rowspan="1" class="confluenceTd">Swagger UI configuration</td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">new <span class="blob-code-inner blob-code-marker-addition"><span
class="pl-smi">SwaggerUiConfig</span>().url("/openapi.json")</span></td><td
colspan="1" rowspan="1" class="confluenceTd"><br clear="none"></td></tr></tbody></table></div><p><span><strong>*</strong>
- t<span>he properties are defined in the OpenAPI class</span></span></p><p><span><span>&#160;</span><span><strong>*</strong></span><span><strong>*</strong></span>
- <span>t<span>he properties are defined in the&#160;SwaggerConfiguration
class</span></span></span></p><h2 id="OpenApiFeature-Configuringfro
 mCode">Configuring from Code</h2><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div></td><td colspan="1" rowspan="1" class="confluenceTd">true</td><td
colspan="1" rowspan="1" class="confluenceTd">true</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">propertiesLocation</td><td colspan="1"
rowspan="1" class="confluenceTd">the properties file location</td><td colspan="1"
rowspan="1" class="confluenceTd">/swagger.properties</td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;/swagger.properties</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">securityDefinitions</td><td colspan="1"
rowspan="1" class="confluenceTd">a list of security definitions<strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>["basicAuth" -&gt; new SecurityScheme().type(Type.HTTP))]</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">customizer</td><td colspan="1" rowspan="1"
class="confluenceTd">the customizer class instance</td><td colspan="1" rowspan="1"
class
 ="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">new
OpenApiCustomizer()</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">swaggerUiMavenGroupAndArtifact</td><td
colspan="1" rowspan="1" class="confluenceTd">the Maven artifacts to pinpoint SwaggerUI</td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"org.webjars.swagger-ui'</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">swaggerUiVersion</td><td colspan="1" rowspan="1"
class="confluenceTd">the version of SwaggerUI</td><td colspan="1" rowspan="1"
class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">"3.13.0"</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">supportSwaggerUi</td><td colspan="1"
rowspan="1" class="confluenceTd">turns on/off SwaggerUI support</td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>null (== true)</strong></td><td
colspan="1" rowspan="1" class="confluenceT
 d">true</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">filterClass</td><td
colspan="1" rowspan="1" class="confluenceTd">a security filter<strong>*</strong><strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"com.example.filter.SampleFilter"</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">resourceClasses</td><td colspan="1"
rowspan="1" class="confluenceTd">a list of resource classes which must be scanned<strong>*</strong><strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">["com.example.rest.SampleResource"]</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">resourcePackages</td><td colspan="1"
rowspan="1" class="confluenceTd">a list of package names where resources must be scanned<strong>*</strong><strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1
 " rowspan="1" class="confluenceTd">["com.example.rest"]</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">ignoredRoutes</td><td colspan="1"
rowspan="1" class="confluenceTd">excludes specific paths when scanning all resources (see
scanAllResources)<span><strong>*</strong><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">["/api/test"]</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">prettyPrint</td><td colspan="1" rowspan="1" class="confluenceTd">when
generating openapi.json, pretty-print the JSON document<span><strong>*</strong><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>true</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</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"><strong>false</strong></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">Scan
all JAX-RS resources automatically</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>true</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">readAllResources</td><td colspan="1"
rowspan="1" class="confluenceTd"><span>Read all operations also with no @Operation<strong>*</strong><strong>*</strong></span><span>&#160;</span></td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>true</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">true</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><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="c
 onfluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">licenseUrl</td><td colspan="1" rowspan="1"
class="confluenceTd">the license URL<strong>*</strong></td><td colspan="1"
rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">"<span
class="nolink"><a shape="rect" class="external-link" href="http://www.apache.org/licenses/LICENSE-2.0.html">http://www.apache.org/licenses/LICENSE-2.0.html</a></span>"</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">license</td><td colspan="1" rowspan="1"
class="confluenceTd">the license<span><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"Apache 2.0 License"</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">contactUrl</td><td colspan="1" rowspan="1" class="confluenceTd">the
contact link<strong>*</strong></td><td colspan=
 "1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">contactEmail</td><td colspan="1"
rowspan="1" class="confluenceTd">the contact email<strong>*</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">"users@<a shape="rect" href="http://cxf.apache.org">cxf.apache.org</a>"</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">contactName</td><td colspan="1" rowspan="1"
class="confluenceTd">the contact name<strong>*</strong></td><td colspan="1"
rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">null</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">description</td><td colspan="1" rowspan="1"
class="confluenceTd">the description<span><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="c
 onfluenceTd">"The Sample REST Application with OpenAPI integration"</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">title</td><td colspan="1" rowspan="1"
class="confluenceTd">the title<span><strong>*</strong></span></td><td
colspan="1" rowspan="1" class="confluenceTd">null</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><strong>*</strong></span></td><td colspan="1"
rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">"1.0.0"</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><span class="blob-code-inner blob-code-marker-addition">swaggerUiConfig</span></td><td
colspan="1" rowspan="1" class="confluenceTd">Swagger UI configuration</td><td
colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1"
class="confluenceTd">new <span class
 ="blob-code-inner blob-code-marker-addition"><span class="pl-smi">SwaggerUiConfig</span>().url("/openapi.json")</span></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">useContextBasedConfig</td><td colspan="1"
rowspan="1" class="confluenceTd">If set, the unique Context Id is going to be generated
for each OpenApiContext instance (see please <a shape="rect" href="openapifeature.html">Using
Multiple Server Endpoints</a>). Also, you very likely may want to set <strong>scan</strong>
property to <strong>false</strong>.</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>false</strong></td><td
colspan="1" rowspan="1" class="confluenceTd">false</td></tr></tbody></table></div><p><span><strong>*</strong>
- t<span>he properties are defined in the OpenAPI class</span></span></p><p><span><span>&#160;</span><span><strong>*</strong></span><span><strong>*</strong></span>
- <span>t<span>he properties are defined in the&#160;SwaggerConfiguration
class</span></span></span></p><h
 2 id="OpenApiFeature-ConfiguringfromCode">Configuring from Code</h2><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
 import io.swagger.v3.oas.models.security.SecurityScheme;
 import io.swagger.v3.oas.models.security.SecurityScheme.Type;
@@ -252,7 +252,12 @@ feature.setSecurityDefinitions(Collectio
     &lt;artifactId&gt;swagger-ui&lt;/artifactId&gt;
     &lt;version&gt;3.13.0&lt;/version&gt;
 &lt;/dependency&gt;</pre>
-</div></div><p>&#160;</p><p>For example, let's assume a
JAX-RS endpoint is published at '<span><a shape="rect" class="external-link" href="http://hostport"
rel="nofollow">http://host:port/context/services/</a></span>'.</p><p>Open
the browser and go to '<span><a shape="rect" class="external-link" href="http://hostport"
rel="nofollow">http://host:port/context/services/</a></span>api-docs/?url=/openapi.json'
which will return a Swagger UI page.</p><p>CXF Services page will also link to
Swagger UI. Go to&#160;'<span><a shape="rect" class="external-link" href="http://hostport"
rel="nofollow">http://host:port/context/services/</a></span>' and follow a
Swagger link which will return a Swagger UI page.</p><p>See <a shape="rect"
class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3"
rel="nofollow">samples/jax_rs/description_openapi_v3</a> as an example.</p><p>To
deactivate automatic Swagger UI integration ple
 ase set<strong> 'supportSwaggerUi'</strong> property to "<strong>false</strong>".</p><h2
id="OpenApiFeature-ConfiguringSwaggerUI(3.2.7+)">Configuring Swagger UI (3.2.7+)</h2><p>The
<strong>OpenApiFeature</strong>&#160; has a way to pre-configure certain&#160;
Swagger UI parameters (<a shape="rect" class="external-link" href="https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md"
rel="nofollow">https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md</a>)
through <strong><span class="blob-code-inner blob-code-marker-addition"><span
class="pl-smi">SwaggerUiConfig</span></span></strong><span class="blob-code-inner
blob-code-marker-addition">. The</span><strong><span class="blob-code-inner
blob-code-marker-addition"> </span></strong>way it is implemented is by passing
those parameters as a query string so the Swagger UI could adjust itself.</p><h2
id="OpenApiFeature-Samples">Samples</h2><p><span>CXF's distribution contains
the followi
 ng samples.</span></p><ul style="list-style-type: square;"><li><span><a
shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3"
rel="nofollow">samples/jax_rs/description_openapi_v3</a>: the <a shape="rect"
class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> standalone sample using OpenApiFeature programmatically</span></li><li><span><span><a
shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3_osgi"
rel="nofollow">samples/jax_rs/description_openapi_v3_osgi</a>: the</span>&#160;</span><span><a
shape="rect" class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> </span>OSGi application sample using <span>OpenApiFeature
</span>using Blueprint</li><li><a sh
 ape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3_web"
rel="nofollow">samples/jax_rs/description_openapi_v3_web</a><span>: the <a
shape="rect" class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> sample using OpenApiFeature inside WAR-based deployment</span></li></ul></div></div>
+</div></div><p>&#160;</p><p>For example, let's assume a
JAX-RS endpoint is published at '<span><a shape="rect" class="external-link" href="http://hostport"
rel="nofollow">http://host:port/context/services/</a></span>'.</p><p>Open
the browser and go to '<span><a shape="rect" class="external-link" href="http://hostport"
rel="nofollow">http://host:port/context/services/</a></span>api-docs/?url=/openapi.json'
which will return a Swagger UI page.</p><p>CXF Services page will also link to
Swagger UI. Go to&#160;'<span><a shape="rect" class="external-link" href="http://hostport"
rel="nofollow">http://host:port/context/services/</a></span>' and follow a
Swagger link which will return a Swagger UI page.</p><p>See <a shape="rect"
class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3"
rel="nofollow">samples/jax_rs/description_openapi_v3</a> as an example.</p><p>To
deactivate automatic Swagger UI integration ple
 ase set<strong> 'supportSwaggerUi'</strong> property to "<strong>false</strong>".</p><h2
id="OpenApiFeature-ConfiguringSwaggerUI(3.2.7+)">Configuring Swagger UI (3.2.7+)</h2><p>The
<strong>OpenApiFeature</strong>&#160; has a way to pre-configure certain&#160;
Swagger UI parameters (<a shape="rect" class="external-link" href="https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md"
rel="nofollow">https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md</a>)
through <strong><span class="blob-code-inner blob-code-marker-addition"><span
class="pl-smi">SwaggerUiConfig</span></span></strong><span class="blob-code-inner
blob-code-marker-addition">. The</span><strong><span class="blob-code-inner
blob-code-marker-addition"> </span></strong>way it is implemented is by passing
those parameters as a query string so the Swagger UI could adjust itself.</p><h2
id="OpenApiFeature-OpenApiFeature-UsingMultipleServerEndpoints(3.3.0+)UsingMultipleServe
 rEndpoints(3.3.0+)"><span class="confluence-anchor-link" id="OpenApiFeature-OpenApiFeature-UsingMultipleServerEndpoints(3.3.0+)"></span>Using
Multiple Server Endpoints (3.3.0+)</h2><p>Quite often there are more than one
<strong>JAXRSServerFactoryBean</strong> configured within same Apache CXF application,
for example, under <strong>"/admin"</strong> and <strong>"/public"</strong>
endpoints. The older <strong>Swagger/OpenAPI v2.0</strong> integrations used such
<strong>basePath</strong> to disambiguate multiple API documentation contexts,
but since <strong>OpenAPI v3.0 Specification</strong> does not explicitly include
the concept of <strong>basePath</strong> anymore, this approach is not working.
Luckily, starting from <strong>2.0.6</strong> release, Swagger OpenAPI v3 implementation
properly supports <strong>Context Id</strong>. To activate it from <strong>OpenApiFeature</strong>,
it is enough to set <strong>useContextBasedConfig </strong>property to <strong>true</strong>
(very lik
 ely you would also want to set <strong>scan</strong> to <strong>false</strong>).</p><p><br
clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">final OpenApiFeature feature
= new OpenApiFeature();
+feature.setScan(false);
+feature.setUseContextBasedConfig(true);
+...</pre>
+</div></div><p>With that, each <strong>OpenApiFeature</strong>
will generate unique <strong>Context Id</strong> and won't see any classes / packages
beyond its own configuration.</p><h2 id="OpenApiFeature-Samples">Samples</h2><p><span>CXF's
distribution contains the following samples.</span></p><ul style="list-style-type:
square;"><li><span><a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3"
rel="nofollow">samples/jax_rs/description_openapi_v3</a>: the <a shape="rect"
class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> standalone sample using OpenApiFeature programmatically</span></li><li><span><span><a
shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3_osgi"
rel="nofollow">samples/jax_rs/description_openapi_v3_
 osgi</a>: the</span>&#160;</span><span><a shape="rect" class="external-link"
href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0" rel="nofollow">OpenAPI
v3.0</a> </span>OSGi application sample using <span>OpenApiFeature </span>using
Blueprint</li><li><a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3_web"
rel="nofollow">samples/jax_rs/description_openapi_v3_web</a><span>: the <a
shape="rect" class="external-link" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0"
rel="nofollow">OpenAPI v3.0</a> sample using OpenApiFeature inside WAR-based deployment</span></li><li><span><a
shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/description_openapi_v3_spring"
rel="nofollow">samples/jax_rs/description_openapi_v3_spring</a>:</span> <span>the
<a shape="rect" class="external-lin
 k" href="https://github.com/OAI/OpenAPI-Specification/releases/tag/3.0.0" rel="nofollow">OpenAPI
v3.0</a> sample using Spring and multiple context paths / OpenApiFeatures</span><br
clear="none"><span><br clear="none"></span></li></ul></div></div>
            </div>
            <!-- Content -->
          </td>



Mime
View raw message