cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject cxf git commit: [CXF-6557] Use the default swagger-ui html page in swagger2 sample
Date Tue, 25 Aug 2015 13:49:07 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f608dd750 -> ee7be61ee


[CXF-6557] Use the default swagger-ui html page in swagger2 sample


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

Branch: refs/heads/master
Commit: ee7be61ee5368d06ee9ab3286d4d44ebcbf9a82c
Parents: f608dd7
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Tue Aug 25 15:47:46 2015 +0200
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Tue Aug 25 15:48:20 2015 +0200

----------------------------------------------------------------------
 .../jax_rs/description_swagger2/README.txt      |  9 +++
 .../samples/jax_rs/description_swagger2/pom.xml |  1 -
 .../java/demo/jaxrs/swagger/server/Server.java  |  2 +-
 .../webjars/swagger-ui/2.1.0/index.html         | 84 --------------------
 4 files changed, 10 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ee7be61e/distribution/src/main/release/samples/jax_rs/description_swagger2/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2/README.txt
b/distribution/src/main/release/samples/jax_rs/description_swagger2/README.txt
index 83a8be7..5e3c9a3 100644
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2/README.txt
+++ b/distribution/src/main/release/samples/jax_rs/description_swagger2/README.txt
@@ -17,6 +17,15 @@ Using either UNIX or Windows:
   mvn -Pserver  (from one command line window)  
     
 
+To view the swagger document, use your Browser to open the page at
+
+  http://localhost:9000/?url=/swagger.json
+
+or
+
+  http://localhost:9000/?url=/swagger.yaml
+
+
 To remove the target dir, run mvn clean".
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/ee7be61e/distribution/src/main/release/samples/jax_rs/description_swagger2/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2/pom.xml b/distribution/src/main/release/samples/jax_rs/description_swagger2/pom.xml
index 555ce69..cff5c2b 100644
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/description_swagger2/pom.xml
@@ -80,7 +80,6 @@
                                     <version>2.1.0</version>
                                     <overWrite>true</overWrite>
                                     <outputDirectory>${project.build.directory}/classes</outputDirectory>
-                                    <excludes>**/index.html</excludes>      
                             
                                 </artifactItem>                                
                             </artifactItems>
                         </configuration>

http://git-wip-us.apache.org/repos/asf/cxf/blob/ee7be61e/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Server.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Server.java
b/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Server.java
index e06d496..1b245c4 100644
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Server.java
+++ b/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Server.java
@@ -46,7 +46,7 @@ public class Server {
             getClass().getResource("/META-INF/resources/webjars/swagger-ui/2.1.0").toURI().toString());
         
         servletHolder.setInitParameter("redirects-list", 
-            "/ /index.html /.*[.]js /css/.* /images/.* lib/.* .*ico");
+            "/ /index.html /.*[.]js /css/.* /images/.* lib/.* .*ico /fonts/.*");
         servletHolder.setInitParameter("redirect-servlet-name", staticHolder.getName());
         servletHolder.setInitParameter("redirect-attributes", "javax.servlet.include.request_uri");
         servletHolder.setInitParameter("jaxrs.serviceClasses", Sample.class.getName());

http://git-wip-us.apache.org/repos/asf/cxf/blob/ee7be61e/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/resources/META-INF/resources/webjars/swagger-ui/2.1.0/index.html
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/resources/META-INF/resources/webjars/swagger-ui/2.1.0/index.html
b/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/resources/META-INF/resources/webjars/swagger-ui/2.1.0/index.html
deleted file mode 100644
index 6095ccc..0000000
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/resources/META-INF/resources/webjars/swagger-ui/2.1.0/index.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- This page is generated from swagger-ui-2.1.0/index.html.gz -->
-<head>
-  <title>Swagger UI + JAX-RS demo</title>
-  <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
-  <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
-  <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
-  <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
-  <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
-  <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
-  <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
-  <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
-  <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
-  <script src='lib/underscore-min.js' type='text/javascript'></script>
-  <script src='lib/backbone-min.js' type='text/javascript'></script>
-  <script src='swagger-ui.js' type='text/javascript'></script>
-  <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
-  <script src='lib/marked.js' type='text/javascript'></script>
-  <script src='lib/swagger-oauth.js' type='text/javascript'></script>
-
-  <script type="text/javascript">
-    $(function () {
-      var url = "/swagger.json";
-      window.swaggerUi = new SwaggerUi({
-        url: url,
-        dom_id: "swagger-ui-container",
-        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
-        onComplete: function(swaggerApi, swaggerUi){
-          if(typeof initOAuth == "function") {
-            initOAuth({
-              clientId: "your-client-id",
-              realm: "your-realms",
-              appName: "your-app-name"
-            });
-          }
-
-          $('pre code').each(function(i, e) {
-            hljs.highlightBlock(e)
-          });
-
-          addApiKeyAuthorization();
-        },
-        onFailure: function(data) {
-          log("Unable to Load SwaggerUI");
-        },
-        docExpansion: "none",
-        apisSorter: "alpha",
-        showRequestHeaders: false
-      });
-
-      function addApiKeyAuthorization(){
-        var key = encodeURIComponent($('#input_apiKey')[0].value);
-        if(key && key.trim() != "") {
-            var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
-            window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
-            log("added key " + key);
-        }
-      }
-
-      $('#input_apiKey').change(addApiKeyAuthorization);
-
-      // if you have an apiKey you would like to pre-populate on the page for demonstration
purposes...
-      /*
-        var apiKey = "myApiKeyXXXX123456789";
-        $('#input_apiKey').val(apiKey);
-      */
-
-      window.swaggerUi.load();
-
-      function log() {
-        if ('console' in window) {
-          console.log.apply(console, arguments);
-        }
-      }
-  });
-  </script>
-</head>
-
-<body class="swagger-section">
-<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>


Mime
View raw message