Skip to content

Commit a7c9c4a

Browse files
committed
updated default locations, readme
1 parent e2585fd commit a7c9c4a

File tree

8 files changed

+91
-47
lines changed

8 files changed

+91
-47
lines changed

samples/java-grails2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Swagger Sample App
22

33
## Overview
4-
This is a grails project to build a stand-alone server which implements the Swagger spec. You can find out more about both the spec and the framework at http://swagger.io. For more information about Wordnik's APIs, please visit http://developer.wordnik.com. There is an online version similar to this server at http://petstore.swagger.wordnik.com/api/api-docs.json
4+
This is a grails project to build a stand-alone server which implements the Swagger spec. You can find out more about both the spec and the framework at http://swagger.io. For more information about Reverb's APIs, please visit http://helloreverb.com. There is an online version similar to this server at http://petstore.swagger.wordnik.com
55

66
### Running the app
77
You do not need to install Grails separately to run this project.

samples/java-jaxrs-cxf/README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Overview
44
This is a java project to build a stand-alone server which implements the Swagger spec. You can find out
5-
more about both the spec and the framework at http://swagger.wordnik.com. For more information
6-
about Wordnik's APIs, please visit http://developer.wordnik.com. There is an online version of this
7-
server at http://petstore.swagger.wordnik.com/api/api-docs
5+
more about both the spec and the framework at http://swagger.io. For more information
6+
about Reverb's APIs, please visit http://helloreverb.com. There is an online version of this
7+
server at http://petstore.swagger.wordnik.com
88

99
This sample creates an `application` context through the `applicationContext.xml`, allowing the `JAXRSServerFactoryBean` to reflect over property packages to discover swagger-enabled resources. This was originally contributed by [chadhahn](https://github.com/chadhahn) and adapted by [rvullriede](https://github.com/rvullriede). Thank you for your contributions!
1010

1111
### To build from source
12-
Please follow instructions to build the top-level [swagger-core project](https://github.com/wordnik/swagger-core)
12+
Please follow instructions to build the top-level [swagger-core project](https://github.com/swagger-api/swagger-core)
1313

1414
### To run (with Maven)
1515
To run the server, run this task:
@@ -20,25 +20,20 @@ mvn package tomcat6:run
2020
This will start Tomcat 6 embedded on port 8002.
2121

2222
### Testing the server
23-
Once started, you can navigate to http://localhost:8002/api/api-docs to view the Swagger Resource Listing.
23+
Once started, you can navigate to http://localhost:8002 to view the Swagger UI.
2424
This tells you that the server is up and ready to demonstrate Swagger.
2525

2626
### Using the UI
27-
There is an HTML5-based API tool available in a separate project. This lets you inspect the API using an
28-
intuitive UI. You can pull this code from here: https://github.com/wordnik/swagger-ui
27+
There is an HTML5-based API tool available in a separate project. This lets you inspect the API using an intuitive UI. You can pull this code from here: https://github.com/swagger-api/swagger-ui
2928

3029
You can then open the dist/index.html file in any HTML5-enabled browser. Upen opening, enter the
31-
URL of your server in the top-centered input box (default is http://localhost:8002/api/api-docs). Click the "Explore"
32-
button and you should see the resources available on the server.
30+
URL of your server in the top-centered input box (default is http://localhost:8002/api/swagger.json). Click the "Explore" button and you should see the resources available on the server.
3331

3432
### Applying an API key
35-
The sample app has an implementation of the Swagger ApiAuthorizationFilter. This restricts access to resources
36-
based on api-key. There are two keys defined in the sample app:
33+
The sample app has an implementation of the Swagger ApiAuthorizationFilter. This restricts access to resources based on api-key. There are two keys defined in the sample app:
3734

3835
<li>- default-key</li>
3936

4037
<li>- special-key</li>
4138

42-
When no key is applied, the "default-key" is applied to all operations. If the "special-key" is entered, a
43-
number of other resources are shown in the UI, including sample CRUD operations. Note this behavior is similar
44-
to that on http://developer.wordnik.com/docs but the behavior is entirely up to the implementor.
39+
When no key is applied, the "default-key" is applied to all operations. If the "special-key" is entered, a number of other resources are shown in the UI, including sample CRUD operations.

samples/java-jaxrs-cxf/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,31 @@
105105
</execution>
106106
</executions>
107107
</plugin>
108+
<plugin>
109+
<artifactId>maven-resources-plugin</artifactId>
110+
<version>2.6</version>
111+
<executions>
112+
<execution>
113+
<id>copy-resources</id>
114+
<phase>validate</phase>
115+
<goals>
116+
<goal>copy-resources</goal>
117+
</goals>
118+
<configuration>
119+
<outputDirectory>target/${project.artifactId}-${project.version}/</outputDirectory>
120+
<resources>
121+
<resource>
122+
<directory>${project.build.directory}/swagger-ui-${swagger-ui-version}/dist</directory>
123+
<filtering>true</filtering>
124+
<excludes>
125+
<exclude>index.html</exclude>
126+
</excludes>
127+
</resource>
128+
</resources>
129+
</configuration>
130+
</execution>
131+
</executions>
132+
</plugin>
108133
</plugins>
109134
</build>
110135

samples/java-jaxrs-cxf/src/main/webapp/index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
<html>
33
<head>
44
<title>Swagger UI</title>
5-
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
5+
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
66
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
77
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
8+
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
9+
<link href='css/screen.css' media='print' rel='stylesheet' type='text/css'/>
810
<script type="text/javascript" src="lib/shred.bundle.js"></script>
911
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
1012
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
1113
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
1214
<script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
13-
<script src='lib/handlebars-1.0.0.js' type='text/javascript'></script>
15+
<script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
1416
<script src='lib/underscore-min.js' type='text/javascript'></script>
1517
<script src='lib/backbone-min.js' type='text/javascript'></script>
16-
<script src='lib/swagger.js' type='text/javascript'></script>
18+
<script src='lib/swagger-client.js' type='text/javascript'></script>
1719
<script src='swagger-ui.js' type='text/javascript'></script>
1820
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
21+
<script src='lib/marked.js' type='text/javascript'></script>
1922

2023
<!-- enabling this will enable oauth2 implicit scope support -->
2124
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
2225

2326
<script type="text/javascript">
2427
$(function () {
2528
window.swaggerUi = new SwaggerUi({
26-
url: "http://localhost:8002/api/api-docs",
29+
url: "http://localhost:8002/api/swagger.json",
2730
dom_id: "swagger-ui-container",
2831
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
2932
onComplete: function(swaggerApi, swaggerUi){

samples/java-jaxrs/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Overview
44
This is a java project to build a stand-alone server which implements the Swagger spec. You can find out
5-
more about both the spec and the framework at http://swagger.wordnik.com. For more information
6-
about Wordnik's APIs, please visit http://developer.wordnik.com. There is an online version of this
7-
server at http://petstore.swagger.wordnik.com/api/api-docs
5+
more about both the spec and the framework at http://swagger.io. For more information
6+
about Reverb's APIs, please visit http://helloreverb.com. There is an online version of this
7+
server at http://petstore.swagger.wordnik.com/
88

99
### To build from source
10-
Please follow instructions to build the top-level [swagger-core project](https://github.com/wordnik/swagger-core)
10+
Please follow instructions to build the top-level [swagger-core project](https://github.com/swagger-api/swagger-core)
1111

1212
### To run (with Maven)
1313
To run the server, run this task:
@@ -18,15 +18,15 @@ mvn package -Dlog4j.configuration=file:./conf/log4j.properties jetty:run
1818
This will start Jetty embedded on port 8002.
1919

2020
### Testing the server
21-
Once started, you can navigate to http://localhost:8002/api/api-docs to view the Swagger Resource Listing.
21+
Once started, you can navigate to http://localhost:8002 to view the Swagger UI.
2222
This tells you that the server is up and ready to demonstrate Swagger.
2323

2424
### Using the UI
2525
There is an HTML5-based API tool available in a separate project. This lets you inspect the API using an
26-
intuitive UI. You can pull this code from here: https://github.com/wordnik/swagger-ui
26+
intuitive UI. You can pull this code from here: https://github.com/swagger-api/swagger-ui
2727

2828
You can then open the dist/index.html file in any HTML5-enabled browser. Upen opening, enter the
29-
URL of your server in the top-centered input box (default is http://localhost:8002/api/api-docs). Click the "Explore"
29+
URL of your server in the top-centered input box (default is http://localhost:8002/api/swagger.json). Click the "Explore"
3030
button and you should see the resources available on the server.
3131

3232
### Applying an API key
@@ -37,6 +37,4 @@ based on api-key. There are two keys defined in the sample app:
3737

3838
<li>- special-key</li>
3939

40-
When no key is applied, the "default-key" is applied to all operations. If the "special-key" is entered, a
41-
number of other resources are shown in the UI, including sample CRUD operations. Note this behavior is similar
42-
to that on http://developer.wordnik.com/docs but the behavior is entirely up to the implementor.
40+
When no key is applied, the "default-key" is applied to all operations. If the "special-key" is entered, a number of other resources are shown in the UI, including sample CRUD operations.

samples/java-jersey-jaxrs/README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Overview
44
This is a java project to build a stand-alone server which implements the Swagger spec. You can find out
5-
more about both the spec and the framework at http://swagger.wordnik.com. For more information
6-
about Wordnik's APIs, please visit http://developer.wordnik.com. There is an online version of this
7-
server at http://petstore.swagger.wordnik.com/api/api-docs
5+
more about both the spec and the framework at http://swagger.io. For more information
6+
about Reverb's APIs, please visit http://helloreverb.com. There is an online version of this
7+
server at http://petstore.swagger.wordnik.com
88

99
### To build from source
10-
Please follow instructions to build the top-level [swagger-core project](https://github.com/wordnik/swagger-core)
10+
Please follow instructions to build the top-level [swagger-core project](https://github.com/swagger-api/swagger-core)
1111

1212
### To run (with Maven)
1313
To run the server, run this task:
@@ -18,25 +18,20 @@ mvn package -Dlog4j.configuration=file:./conf/log4j.properties jetty:run
1818
This will start Jetty embedded on port 8002.
1919

2020
### Testing the server
21-
Once started, you can navigate to http://localhost:8002/api/api-docs to view the Swagger Resource Listing.
21+
Once started, you can navigate to http://localhost:8002 to view the Swagger UI.
2222
This tells you that the server is up and ready to demonstrate Swagger.
2323

2424
### Using the UI
25-
There is an HTML5-based API tool available in a separate project. This lets you inspect the API using an
26-
intuitive UI. You can pull this code from here: https://github.com/wordnik/swagger-ui
25+
There is an HTML5-based API tool available in a separate project. This lets you inspect the API using an intuitive UI. You can pull this code from here: https://github.com/swagger-api/swagger-ui
2726

2827
You can then open the dist/index.html file in any HTML5-enabled browser. Upen opening, enter the
29-
URL of your server in the top-centered input box (default is http://localhost:8002/api/api-docs). Click the "Explore"
30-
button and you should see the resources available on the server.
28+
URL of your server in the top-centered input box (default is http://localhost:8002/api/swagger.json). Click the "Explore" button and you should see the resources available on the server.
3129

3230
### Applying an API key
33-
The sample app has an implementation of the Swagger ApiAuthorizationFilter. This restricts access to resources
34-
based on api-key. There are two keys defined in the sample app:
31+
The sample app has an implementation of the Swagger ApiAuthorizationFilter. This restricts access to resources based on api-key. There are two keys defined in the sample app:
3532

3633
<li>- default-key</li>
3734

3835
<li>- special-key</li>
3936

40-
When no key is applied, the "default-key" is applied to all operations. If the "special-key" is entered, a
41-
number of other resources are shown in the UI, including sample CRUD operations. Note this behavior is similar
42-
to that on http://developer.wordnik.com/docs but the behavior is entirely up to the implementor.
37+
When no key is applied, the "default-key" is applied to all operations. If the "special-key" is entered, a number of other resources are shown in the UI, including sample CRUD operations.

samples/java-jersey-jaxrs/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,31 @@
9090
</execution>
9191
</executions>
9292
</plugin>
93+
<plugin>
94+
<artifactId>maven-resources-plugin</artifactId>
95+
<version>2.6</version>
96+
<executions>
97+
<execution>
98+
<id>copy-resources</id>
99+
<phase>validate</phase>
100+
<goals>
101+
<goal>copy-resources</goal>
102+
</goals>
103+
<configuration>
104+
<outputDirectory>target/${project.artifactId}-${project.version}</outputDirectory>
105+
<resources>
106+
<resource>
107+
<directory>${project.build.directory}/swagger-ui-${swagger-ui-version}/dist</directory>
108+
<filtering>true</filtering>
109+
<excludes>
110+
<exclude>index.html</exclude>
111+
</excludes>
112+
</resource>
113+
</resources>
114+
</configuration>
115+
</execution>
116+
</executions>
117+
</plugin>
93118
</plugins>
94119
</build>
95120
<dependencies>

samples/java-jersey-jaxrs/src/main/webapp/index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
<html>
33
<head>
44
<title>Swagger UI</title>
5-
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
5+
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
66
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
77
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
8+
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
9+
<link href='css/screen.css' media='print' rel='stylesheet' type='text/css'/>
810
<script type="text/javascript" src="lib/shred.bundle.js"></script>
911
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
1012
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
1113
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
1214
<script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
13-
<script src='lib/handlebars-1.0.0.js' type='text/javascript'></script>
15+
<script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
1416
<script src='lib/underscore-min.js' type='text/javascript'></script>
1517
<script src='lib/backbone-min.js' type='text/javascript'></script>
16-
<script src='lib/swagger.js' type='text/javascript'></script>
18+
<script src='lib/swagger-client.js' type='text/javascript'></script>
1719
<script src='swagger-ui.js' type='text/javascript'></script>
1820
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
21+
<script src='lib/marked.js' type='text/javascript'></script>
1922

2023
<!-- enabling this will enable oauth2 implicit scope support -->
2124
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
2225

2326
<script type="text/javascript">
2427
$(function () {
2528
window.swaggerUi = new SwaggerUi({
26-
url: "http://localhost:8002/api/api-docs",
29+
url: "http://localhost:8002/api/swagger.json",
2730
dom_id: "swagger-ui-container",
2831
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
2932
onComplete: function(swaggerApi, swaggerUi){

0 commit comments

Comments
 (0)