You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2015/08/25 16:02:37 UTC
[1/2] cxf git commit: [CXF-6557] Use the default swagger-ui html page
in swagger2 sample
Repository: cxf
Updated Branches:
refs/heads/3.0.x-fixes 3341bbc56 -> 513c5913a
[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/9cfd30ba
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9cfd30ba
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9cfd30ba
Branch: refs/heads/3.0.x-fixes
Commit: 9cfd30ba3ad50223eb255a78522f09cab72be56c
Parents: 3341bbc
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:49:32 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/9cfd30ba/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/9cfd30ba/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 2bfdc0a..32e0e36 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
@@ -79,7 +79,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/9cfd30ba/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/9cfd30ba/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"> </div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>
[2/2] cxf git commit: [CXF-6557] Use the default swagger-ui html page
in swagger2_web sample
Posted by ay...@apache.org.
[CXF-6557] Use the default swagger-ui html page in swagger2_web sample
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/513c5913
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/513c5913
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/513c5913
Branch: refs/heads/3.0.x-fixes
Commit: 513c5913ace550658a528216a0fdd5cbf2c89e91
Parents: 9cfd30b
Author: Akitoshi Yoshida <ay...@apache.org>
Authored: Tue Aug 25 16:00:57 2015 +0200
Committer: Akitoshi Yoshida <ay...@apache.org>
Committed: Tue Aug 25 16:02:20 2015 +0200
----------------------------------------------------------------------
.../jax_rs/description_swagger2_web/README.txt | 9 ++-
.../jax_rs/description_swagger2_web/pom.xml | 3 -
.../src/main/webapp/index.html | 84 --------------------
3 files changed, 8 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/513c5913/distribution/src/main/release/samples/jax_rs/description_swagger2_web/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2_web/README.txt b/distribution/src/main/release/samples/jax_rs/description_swagger2_web/README.txt
index 7ecb9f2..3605e65 100644
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2_web/README.txt
+++ b/distribution/src/main/release/samples/jax_rs/description_swagger2_web/README.txt
@@ -15,8 +15,15 @@ located), the Maven pom.xml file can be used to build and run the demo.
Using either UNIX or Windows:
mvn install
- mvn package tomcat7:run (from one command line window)
+ mvn package tomcat7:run
+To view the swagger document, use your Browser and open the page at
+
+ http://localhost:9000/?url=/app/swaggerSample/swagger.json
+
+or
+
+ http://localhost:9000/?url=/app/swaggerSample/swagger.yaml
To remove the target dir, run mvn clean".
http://git-wip-us.apache.org/repos/asf/cxf/blob/513c5913/distribution/src/main/release/samples/jax_rs/description_swagger2_web/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2_web/pom.xml b/distribution/src/main/release/samples/jax_rs/description_swagger2_web/pom.xml
index 293f6ea..560456c 100644
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2_web/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/description_swagger2_web/pom.xml
@@ -77,9 +77,6 @@ under the License.
<resource>
<directory>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/2.1.0</directory>
<filtering>true</filtering>
- <excludes>
- <exclude>index.html</exclude>
- </excludes>
</resource>
</resources>
</configuration>
http://git-wip-us.apache.org/repos/asf/cxf/blob/513c5913/distribution/src/main/release/samples/jax_rs/description_swagger2_web/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger2_web/src/main/webapp/index.html b/distribution/src/main/release/samples/jax_rs/description_swagger2_web/src/main/webapp/index.html
deleted file mode 100644
index b32bb69..0000000
--- a/distribution/src/main/release/samples/jax_rs/description_swagger2_web/src/main/webapp/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 = "/app/swaggerSample/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"> </div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>