Skip to content

Commit a4ce6d7

Browse files
committed
updated scripts
1 parent 3739d28 commit a4ce6d7

File tree

5 files changed

+161
-85
lines changed

5 files changed

+161
-85
lines changed

bin/jaxrs-petstore-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ fi
2626

2727
# if you've executed sbt assembly previously it will use that instead.
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29-
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l jaxrs -o samples/server/petstore/jaxrs"
29+
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l jaxrs -o samples/server/petstore/jaxrs"
3030

3131
java $JAVA_OPTS -jar $executable $ags

bin/objc-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
2929
ags="$@ generate -t modules/swagger-codegen/src/main/resources/objc -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l objc -o samples/client/petstore/objc"
3030

31-
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags
31+
java -DdebugModels -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags

bin/python-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ fi
2626

2727
# if you've executed sbt assembly previously it will use that instead.
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29-
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l python -o samples/client/petstore/python"
29+
ags="$@ generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l python -o samples/client/petstore/python"
3030

3131
java $JAVA_OPTS -jar $executable $ags

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,20 @@
314314
<module>samples/server/petstore/jaxrs</module>
315315
</modules>
316316
</profile>
317+
<profile>
318+
<id>samples</id>
319+
<activation>
320+
<property>
321+
<name>env</name>
322+
<value>samples</value>
323+
</property>
324+
</activation>
325+
<modules>
326+
<module>samples/client/petstore/java</module>
327+
<module>samples/server/petstore/jaxrs</module>
328+
<module>samples/client/petstore/objc</module>
329+
</modules>
330+
</profile>
317331
</profiles>
318332
<modules>
319333
<module>modules/swagger-codegen</module>

samples/html/index.html

Lines changed: 144 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ <h1>Swagger Petstore</h1>
99
<div class="app-desc">This is a sample server Petstore server. You can find out more about Swagger at <a href="http://swagger.io">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key "special-key" to test the authorization filters for our Partner</div>
1010

1111
<div class="app-desc">Contact Info: <a href="[email protected]">[email protected]</a></div>
12+
<div class="app-desc">Version: 1.0.0</div>
1213
<div class="license-info">Apache 2.0</div>
1314
<div class="license-url">http://www.apache.org/licenses/LICENSE-2.0.html</div>
1415
<h2>Access</h2>
@@ -97,6 +98,14 @@ <h3 class="field-label">Return type</h3>
9798
<div class="return-type"><a href="#">String</a></div>
9899

99100

101+
<h3 class="field-label">Example data</h3>
102+
<div class="example-data-content-type">Content-Type: application/json</div>
103+
<pre class="example"><code>"aeiou"</code></pre>
104+
105+
<h3 class="field-label">Example data</h3>
106+
<div class="example-data-content-type">Content-Type: application/xml</div>
107+
<pre class="example"><code>string</code></pre>
108+
100109
</div> <!-- method -->
101110
<hr>
102111

@@ -134,6 +143,14 @@ <h3 class="field-label">Return type</h3>
134143
<div class="return-type"><a href="#">User</a></div>
135144

136145

146+
<h3 class="field-label">Example data</h3>
147+
<div class="example-data-content-type">Content-Type: application/json</div>
148+
<pre class="example"><code>{\n "id" : 123456789,\n "lastName" : "aeiou",\n "phone" : "aeiou",\n "username" : "aeiou",\n "email" : "aeiou",\n "userStatus" : 123,\n "firstName" : "aeiou",\n "password" : "aeiou"\n}</code></pre>
149+
150+
<h3 class="field-label">Example data</h3>
151+
<div class="example-data-content-type">Content-Type: application/xml</div>
152+
<pre class="example"><code><User>\n <id>123456</id>\n <username>string</username>\n <firstName>string</firstName>\n <lastName>string</lastName>\n <email>string</email>\n <password>string</password>\n <phone>string</phone>\n <userStatus>0</userStatus>\n</User></code></pre>
153+
137154
</div> <!-- method -->
138155
<hr>
139156

@@ -182,85 +199,6 @@ <h3 class="field-label">Return type</h3>
182199

183200

184201

185-
<div class="method">
186-
<div class="method-path"><pre class="get"><code class="huge"><span>get</span>: /store/inventory</code></pre></div>
187-
<div class="method-summary"><span class="nickname">getInventory</span> Returns pet inventories by status</div>
188-
<div class="method-notes">Returns a map of status codes to quantities</div>
189-
190-
<h3 class="field-label">Parameters</h3>
191-
<div class="field-items">
192-
193-
</div> <!-- field-items -->
194-
<h3 class="field-label">Return type</h3>
195-
196-
<div class="return-type"><a href="#map">map[String, Integer]</a></div>
197-
198-
199-
</div> <!-- method -->
200-
<hr>
201-
202-
<div class="method">
203-
<div class="method-path"><pre class="post"><code class="huge"><span>post</span>: /store/order</code></pre></div>
204-
<div class="method-summary"><span class="nickname">placeOrder</span> Place an order for a pet</div>
205-
<div class="method-notes"></div>
206-
207-
<h3 class="field-label">Parameters</h3>
208-
<div class="field-items">
209-
<div class="param">body (optional)</div>
210-
211-
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; order placed for purchasing the pet </div>
212-
213-
</div> <!-- field-items -->
214-
<h3 class="field-label">Return type</h3>
215-
216-
<div class="return-type"><a href="#">Order</a></div>
217-
218-
219-
</div> <!-- method -->
220-
<hr>
221-
222-
<div class="method">
223-
<div class="method-path"><pre class="get"><code class="huge"><span>get</span>: /store/order/{orderId}</code></pre></div>
224-
<div class="method-summary"><span class="nickname">getOrderById</span> Find purchase order by ID</div>
225-
<div class="method-notes">For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions</div>
226-
227-
<h3 class="field-label">Parameters</h3>
228-
<div class="field-items">
229-
<div class="param">orderId (required)</div>
230-
231-
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet that needs to be fetched </div>
232-
233-
</div> <!-- field-items -->
234-
<h3 class="field-label">Return type</h3>
235-
236-
<div class="return-type"><a href="#">Order</a></div>
237-
238-
239-
</div> <!-- method -->
240-
<hr>
241-
242-
<div class="method">
243-
<div class="method-path"><pre class="delete"><code class="huge"><span>delete</span>: /store/order/{orderId}</code></pre></div>
244-
<div class="method-summary"><span class="nickname">deleteOrder</span> Delete purchase order by ID</div>
245-
<div class="method-notes">For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors</div>
246-
247-
<h3 class="field-label">Parameters</h3>
248-
<div class="field-items">
249-
<div class="param">orderId (required)</div>
250-
251-
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of the order that needs to be deleted </div>
252-
253-
</div> <!-- field-items -->
254-
<h3 class="field-label">Return type</h3>
255-
256-
<div class="return-type"><a href="#"></a></div>
257-
258-
259-
</div> <!-- method -->
260-
<hr>
261-
262-
263-
264202
<div class="method">
265203
<div class="method-path"><pre class="put"><code class="huge"><span>put</span>: /pet</code></pre></div>
266204
<div class="method-summary"><span class="nickname">updatePet</span> Update an existing pet</div>
@@ -318,6 +256,14 @@ <h3 class="field-label">Return type</h3>
318256
<div class="return-type"><a href="#array">array[Pet]</a></div>
319257

320258

259+
<h3 class="field-label">Example data</h3>
260+
<div class="example-data-content-type">Content-Type: application/json</div>
261+
<pre class="example"><code>[ {\n "tags" : [ {\n "id" : 123456789,\n "name" : "aeiou"\n } ],\n "id" : 123456789,\n "category" : {\n "id" : 123456789,\n "name" : "aeiou"\n },\n "status" : "aeiou",\n "name" : "doggie",\n "photoUrls" : [ "aeiou" ]\n} ]</code></pre>
262+
263+
<h3 class="field-label">Example data</h3>
264+
<div class="example-data-content-type">Content-Type: application/xml</div>
265+
<pre class="example"><code><Pet>\n <id>123456</id>\n <Category>\n <id>123456</id>\n <name>string</name>\n </Category>\n <name>doggie</name>\n <photoUrls>string</photoUrls>\n <Tag>\n <id>123456</id>\n <name>string</name>\n </Tag>\n <status>string</status>\n</Pet></code></pre>
266+
321267
</div> <!-- method -->
322268
<hr>
323269

@@ -338,6 +284,14 @@ <h3 class="field-label">Return type</h3>
338284
<div class="return-type"><a href="#array">array[Pet]</a></div>
339285

340286

287+
<h3 class="field-label">Example data</h3>
288+
<div class="example-data-content-type">Content-Type: application/json</div>
289+
<pre class="example"><code>[ {\n "tags" : [ {\n "id" : 123456789,\n "name" : "aeiou"\n } ],\n "id" : 123456789,\n "category" : {\n "id" : 123456789,\n "name" : "aeiou"\n },\n "status" : "aeiou",\n "name" : "doggie",\n "photoUrls" : [ "aeiou" ]\n} ]</code></pre>
290+
291+
<h3 class="field-label">Example data</h3>
292+
<div class="example-data-content-type">Content-Type: application/xml</div>
293+
<pre class="example"><code><Pet>\n <id>123456</id>\n <Category>\n <id>123456</id>\n <name>string</name>\n </Category>\n <name>doggie</name>\n <photoUrls>string</photoUrls>\n <Tag>\n <id>123456</id>\n <name>string</name>\n </Tag>\n <status>string</status>\n</Pet></code></pre>
294+
341295
</div> <!-- method -->
342296
<hr>
343297

@@ -358,6 +312,14 @@ <h3 class="field-label">Return type</h3>
358312
<div class="return-type"><a href="#">Pet</a></div>
359313

360314

315+
<h3 class="field-label">Example data</h3>
316+
<div class="example-data-content-type">Content-Type: application/json</div>
317+
<pre class="example"><code>{\n "tags" : [ {\n "id" : 123456789,\n "name" : "aeiou"\n } ],\n "id" : 123456789,\n "category" : {\n "id" : 123456789,\n "name" : "aeiou"\n },\n "status" : "aeiou",\n "name" : "doggie",\n "photoUrls" : [ "aeiou" ]\n}</code></pre>
318+
319+
<h3 class="field-label">Example data</h3>
320+
<div class="example-data-content-type">Content-Type: application/xml</div>
321+
<pre class="example"><code><Pet>\n <id>123456</id>\n <Category>\n <id>123456</id>\n <name>string</name>\n </Category>\n <name>doggie</name>\n <photoUrls>string</photoUrls>\n <Tag>\n <id>123456</id>\n <name>string</name>\n </Tag>\n <status>string</status>\n</Pet></code></pre>
322+
361323
</div> <!-- method -->
362324
<hr>
363325

@@ -417,12 +379,9 @@ <h3 class="field-label">Return type</h3>
417379

418380
<h3 class="field-label">Parameters</h3>
419381
<div class="field-items">
420-
<<<<<<< HEAD
421-
=======
422382
<div class="param">petId (required)</div>
423383

424384
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet to update </div>
425-
>>>>>>> master
426385
<div class="param">additionalMetadata (optional)</div>
427386

428387
<div class="param-desc"><span class="param-type">Form Parameter</span> &mdash; Additional data to pass to server </div>
@@ -440,6 +399,109 @@ <h3 class="field-label">Return type</h3>
440399
<hr>
441400

442401

402+
403+
<div class="method">
404+
<div class="method-path"><pre class="get"><code class="huge"><span>get</span>: /store/inventory</code></pre></div>
405+
<div class="method-summary"><span class="nickname">getInventory</span> Returns pet inventories by status</div>
406+
<div class="method-notes">Returns a map of status codes to quantities</div>
407+
408+
<h3 class="field-label">Parameters</h3>
409+
<div class="field-items">
410+
411+
</div> <!-- field-items -->
412+
<h3 class="field-label">Return type</h3>
413+
414+
<div class="return-type"><a href="#map">map[String, Integer]</a></div>
415+
416+
417+
<h3 class="field-label">Example data</h3>
418+
<div class="example-data-content-type">Content-Type: application/json</div>
419+
<pre class="example"><code>{\n "key" : 123\n}</code></pre>
420+
421+
<h3 class="field-label">Example data</h3>
422+
<div class="example-data-content-type">Content-Type: application/xml</div>
423+
<pre class="example"><code>not implemented com.wordnik.swagger.models.properties.MapProperty@64e17c9c</code></pre>
424+
425+
</div> <!-- method -->
426+
<hr>
427+
428+
<div class="method">
429+
<div class="method-path"><pre class="post"><code class="huge"><span>post</span>: /store/order</code></pre></div>
430+
<div class="method-summary"><span class="nickname">placeOrder</span> Place an order for a pet</div>
431+
<div class="method-notes"></div>
432+
433+
<h3 class="field-label">Parameters</h3>
434+
<div class="field-items">
435+
<div class="param">body (optional)</div>
436+
437+
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; order placed for purchasing the pet </div>
438+
439+
</div> <!-- field-items -->
440+
<h3 class="field-label">Return type</h3>
441+
442+
<div class="return-type"><a href="#">Order</a></div>
443+
444+
445+
<h3 class="field-label">Example data</h3>
446+
<div class="example-data-content-type">Content-Type: application/json</div>
447+
<pre class="example"><code>{\n "id" : 123456789,\n "petId" : 123456789,\n "complete" : true,\n "status" : "aeiou",\n "quantity" : 123,\n "shipDate" : "2015-03-30T01:51:23.181+0000"\n}</code></pre>
448+
449+
<h3 class="field-label">Example data</h3>
450+
<div class="example-data-content-type">Content-Type: application/xml</div>
451+
<pre class="example"><code><Order>\n <id>123456</id>\n <petId>123456</petId>\n <quantity>0</quantity>\n <shipDate>2015-03-29T18:51:23.183Z</shipDate>\n <status>string</status>\n <complete>true</complete>\n</Order></code></pre>
452+
453+
</div> <!-- method -->
454+
<hr>
455+
456+
<div class="method">
457+
<div class="method-path"><pre class="get"><code class="huge"><span>get</span>: /store/order/{orderId}</code></pre></div>
458+
<div class="method-summary"><span class="nickname">getOrderById</span> Find purchase order by ID</div>
459+
<div class="method-notes">For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions</div>
460+
461+
<h3 class="field-label">Parameters</h3>
462+
<div class="field-items">
463+
<div class="param">orderId (required)</div>
464+
465+
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of pet that needs to be fetched </div>
466+
467+
</div> <!-- field-items -->
468+
<h3 class="field-label">Return type</h3>
469+
470+
<div class="return-type"><a href="#">Order</a></div>
471+
472+
473+
<h3 class="field-label">Example data</h3>
474+
<div class="example-data-content-type">Content-Type: application/json</div>
475+
<pre class="example"><code>{\n "id" : 123456789,\n "petId" : 123456789,\n "complete" : true,\n "status" : "aeiou",\n "quantity" : 123,\n "shipDate" : "2015-03-30T01:51:23.184+0000"\n}</code></pre>
476+
477+
<h3 class="field-label">Example data</h3>
478+
<div class="example-data-content-type">Content-Type: application/xml</div>
479+
<pre class="example"><code><Order>\n <id>123456</id>\n <petId>123456</petId>\n <quantity>0</quantity>\n <shipDate>2015-03-29T18:51:23.185Z</shipDate>\n <status>string</status>\n <complete>true</complete>\n</Order></code></pre>
480+
481+
</div> <!-- method -->
482+
<hr>
483+
484+
<div class="method">
485+
<div class="method-path"><pre class="delete"><code class="huge"><span>delete</span>: /store/order/{orderId}</code></pre></div>
486+
<div class="method-summary"><span class="nickname">deleteOrder</span> Delete purchase order by ID</div>
487+
<div class="method-notes">For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors</div>
488+
489+
<h3 class="field-label">Parameters</h3>
490+
<div class="field-items">
491+
<div class="param">orderId (required)</div>
492+
493+
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; ID of the order that needs to be deleted </div>
494+
495+
</div> <!-- field-items -->
496+
<h3 class="field-label">Return type</h3>
497+
498+
<div class="return-type"><a href="#"></a></div>
499+
500+
501+
</div> <!-- method -->
502+
<hr>
503+
504+
443505

444506
<h2>Models</h2>
445507

0 commit comments

Comments
 (0)