cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject cxf-fediz git commit: [FEDIZ-145] Adding Swagger 2 Feature for REST API
Date Mon, 18 Jan 2016 07:53:23 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master a7aa8170a -> 0d30b0129


[FEDIZ-145] Adding Swagger 2 Feature for REST API


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/0d30b012
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/0d30b012
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/0d30b012

Branch: refs/heads/master
Commit: 0d30b0129d0900b281a988f9472e30a140c98d44
Parents: a7aa817
Author: Jan Bernhardt <jbernhardt@talend.com>
Authored: Mon Jan 18 08:52:58 2016 +0100
Committer: Jan Bernhardt <jbernhardt@talend.com>
Committed: Mon Jan 18 08:52:58 2016 +0100

----------------------------------------------------------------------
 services/idp/pom.xml                            | 15 +++++++++++
 services/idp/src/main/resources/restContext.xml | 26 ++++++++++++++++----
 2 files changed, 36 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/0d30b012/services/idp/pom.xml
----------------------------------------------------------------------
diff --git a/services/idp/pom.xml b/services/idp/pom.xml
index 9e0ffbf..baa33f1 100644
--- a/services/idp/pom.xml
+++ b/services/idp/pom.xml
@@ -237,6 +237,17 @@
             <artifactId>el-api</artifactId>
             <version>${javax.el.version}</version>
         </dependency>
+        <dependency>
+        	<groupId>io.swagger</groupId>
+        	<artifactId>swagger-jaxrs</artifactId>
+        	<version>1.5.6</version>
+        </dependency>
+        <dependency>
+           <groupId>org.webjars</groupId>
+           <artifactId>swagger-ui</artifactId>
+           <version>2.1.0</version>
+           <scope>provided</scope>
+       </dependency>
     </dependencies>
     <build>
         <resources>
@@ -247,6 +258,7 @@
                     <include>**/realm.properties</include>
                     <include>**/persistence.properties</include>
                     <include>**/web.xml</include>
+                    <include>**/restContext.xml</include>
                 </includes>
             </resource>
             <resource>
@@ -256,6 +268,7 @@
                     <exclude>**/realm.properties</exclude>
                     <exclude>**/persistence.properties</exclude>
                     <exclude>**/web.xml</exclude>
+                    <exclude>**/restContext.xml</exclude>
                 </excludes>
             </resource>
         </resources>
@@ -308,6 +321,7 @@
                             <includes>
                                 <include>**/applicationContext.xml</include>
                                 <include>**/web.xml</include>
+								<include>**/restContext.xml</include>
                             </includes>
                         </resource>
                         <resource>
@@ -316,6 +330,7 @@
                             <excludes>
                                 <exclude>**/applicationContext.xml</exclude>
                                 <exclude>**/web.xml</exclude>
+								<exclude>**/restContext.xml</exclude>
                             </excludes>
                         </resource>
                     </webResources>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/0d30b012/services/idp/src/main/resources/restContext.xml
----------------------------------------------------------------------
diff --git a/services/idp/src/main/resources/restContext.xml b/services/idp/src/main/resources/restContext.xml
index ce58024..6e3aaaf 100644
--- a/services/idp/src/main/resources/restContext.xml
+++ b/services/idp/src/main/resources/restContext.xml
@@ -29,13 +29,11 @@
         http://cxf.apache.org/schemas/jaxrs.xsd">
 
 <!-- 
-<context:component-scan base-package="org.apache.cxf.fediz.service.idp.protocols" />
+    <context:component-scan base-package="org.apache.cxf.fediz.service.idp.protocols"
/>
     
-    
-    <bean
-        class="org.apache.cxf.fediz.service.idp.protocols.TrustedIdpProtocolHandlerImpl"
/>
-      -->   
+    <bean class="org.apache.cxf.fediz.service.idp.protocols.TrustedIdpProtocolHandlerImpl"
/>  
     <context:property-placeholder location="classpath:realm.properties"/>
+--> 
     
     <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
         <property name="depthProperties">
@@ -56,7 +54,22 @@
         class="org.apache.cxf.fediz.service.idp.rest.RestServiceExceptionMapper" />
 
     <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider"
/>
+    
+     <!-- CXF Swagger2Feature -->
+    <bean id="swagger2Feature" class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
+        <property name="title" value="Apache Fediz IDP" />
+        <property name="version" value="${project.version}" />
+        <property name="description" value="Apache Fediz IDP ${project.version}" />
+        <property name="contact" value="dev@cxf.apache.org" />
+
+        <property name="resourcePackage" value="org.apache.cxf.fediz.service.idp.rest"
/>
+        <property name="scanAllResources" value="true" />
 
+        <property name="dynamicBasePath" value="true" />
+        <property name="replaceTags" value="true" />
+        <property name="prettyPrint" value="true" />
+    </bean>
+    
     <jaxrs:server id="idpService" address="/rs">
         <jaxrs:serviceBeans>
             <ref bean="idpServiceImpl" />
@@ -72,6 +85,9 @@
             <ref bean="jsonProvider" />
             <ref bean="exceptionMapper" />
         </jaxrs:providers>
+        <jaxrs:features>
+            <ref bean="swagger2Feature" />
+        </jaxrs:features>
         <jaxrs:extensionMappings>
             <entry key="json" value="application/json;charset=UTF-8" />
             <entry key="xml" value="application/xml;charset=UTF-8" />


Mime
View raw message