I'm trying to use the CXF feature
https://cxf.apache.org/docs/swagger2feature.html on fortress 3.0.0 to get
API access over swagger interface. I've already added these lines but I
don't understand where I need to turn the feature on in java code. Could
you please give me some advice on this?

--- a/src/main/resources/applicationContext.xml
+++ b/src/main/resources/applicationContext.xml
@@ -46,6 +46,12 @@ under the License.
     </bean>

     <bean id="fortressResponseInterceptor"
class="org.apache.directory.fortress.rest.FortressResponseInterceptor"/>
+
+    <!-- CXF Swagger2Feature -->
+    <bean id="swagger2Feature"
class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
+        <!-- customize some of the properties -->
+        <property name="basePath" value="/app/swaggerSample"/>
+    </bean>

     <jaxrs:server id="restContainer" address="/">
         <jaxrs:serviceBeans>
@@ -67,6 +73,11 @@ under the License.
         <jaxrs:providers>
            <ref bean="customJsonProvider"/>
         </jaxrs:providers>
+
+        <!-- Swagger -->
+        <jaxrs:features>
+            <ref bean="swagger2Feature" />
+        </jaxrs:features>
     </jaxrs:server>

 </beans>

-- 
Regards,
Veniamin

Reply via email to