Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions bin/html2-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"

if [ ! -f "$executable" ]
then
mvn clean package
fi

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

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,16 @@ public String apiFileFolder() {
public String modelFileFolder() {
return outputFolder + File.separator + sourceFolder + File.separator + "models";
}

@Override
public String escapeQuotationMark(String input) {
// just return the original string
return input;
}

@Override
public String escapeUnsafeCharacters(String input) {
// just return the original string
return input;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,16 @@ private String sanitizePath(String p) {
public String normalizeType(String type) {
return type.replaceAll("\\b(Boolean|Integer|Number|String|Date)\\b", "'$1'");
}

@Override
public String escapeQuotationMark(String input) {
// just return the original string
return input;
}

@Override
public String escapeUnsafeCharacters(String input) {
// just return the original string
return input;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,17 @@ public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
}
return objs;
}


@Override
public String escapeQuotationMark(String input) {
// just return the original string
return input;
}

@Override
public String escapeUnsafeCharacters(String input) {
// just return the original string
return input;
}
}
86 changes: 43 additions & 43 deletions samples/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,18 @@ <h3 class="field-label">Example data</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ]</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -416,18 +416,18 @@ <h3 class="field-label">Example data</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
} ]</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -489,18 +489,18 @@ <h3 class="field-label">Example data</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"id" : 123456789,
"category" : {
"name" : "aeiou",
"id" : 123456789
"id" : 123456789,
"name" : "aeiou"
},
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
}</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -665,9 +665,9 @@ <h3 class="field-label">Return type</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"message" : "aeiou",
"code" : 123,
"type" : "aeiou",
"message" : "aeiou"
"type" : "aeiou"
}</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -803,12 +803,12 @@ <h3 class="field-label">Example data</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"petId" : 123456789,
"quantity" : 123,
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -871,12 +871,12 @@ <h3 class="field-label">Example data</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"petId" : 123456789,
"quantity" : 123,
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"petId" : 123456789,
"complete" : true,
"status" : "aeiou"
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+00:00"
}</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -1089,14 +1089,14 @@ <h3 class="field-label">Example data</h3>
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"firstName" : "aeiou",
"id" : 123456789,
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
"id" : 123456789,
"username" : "aeiou",
"email" : "aeiou",
"username" : "aeiou"
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
}</code></pre>

<h3 class="field-label">Produces</h3>
Expand Down Expand Up @@ -1274,7 +1274,7 @@ <h3 class="field-label"><a name="ApiResponse">ApiResponse - An uploaded response
</div> <!-- field-items -->
</div>
<div class="model">
<h3 class="field-label"><a name="Category">Category - Pet catehory</a> <a class="up" href="#__Models">Up</a></h3>
<h3 class="field-label"><a name="Category">Category - Pet catehgry</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>A category for a pet</div>
<div class="field-items">
<div class="param">id (optional)</div><div class="param-desc"><span class="param-type"><a href="#long">Long</a></span> format: int64</div>
Expand Down
23 changes: 23 additions & 0 deletions samples/html2/.swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Loading