From beeb02a2dccca2368e4ff1a8c836956bdf99c766 Mon Sep 17 00:00:00 2001 From: weiyang Date: Tue, 13 Dec 2016 15:52:22 +0800 Subject: [PATCH] [html] Add type anchor to body param block (#4368) * [html] Add type anchor to 'bodyParam' block Signed-off-by: weiyang * [html][samples] Add type anchor to 'bodyParam' block Signed-off-by: weiyang --- .../resources/htmlDocs/bodyParam.mustache | 4 +- samples/html/index.html | 107 ++++++++++-------- 2 files changed, 59 insertions(+), 52 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache index 45b0373e9c5..9af8790a0e0 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache @@ -1,3 +1,3 @@ -{{#isBodyParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
+{{#isBodyParam}}
{{baseName}} {{#baseType}}{{baseType}}{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Body Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isBodyParam}} \ No newline at end of file +
Body Parameter — {{description}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isBodyParam}} diff --git a/samples/html/index.html b/samples/html/index.html index 850fa5752d0..5d4bf9f1493 100644 --- a/samples/html/index.html +++ b/samples/html/index.html @@ -246,9 +246,10 @@ font-style: italic;

Request body

-
body (required)
+
body Pet (required)
Body Parameter — Pet object that needs to be added to the store
+
@@ -355,18 +356,18 @@ font-style: italic;

Example data

Content-Type: application/json
[ {
-  "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" ]
 } ]

Produces

@@ -428,18 +429,18 @@ font-style: italic;

Example data

Content-Type: application/json
[ {
-  "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" ]
 } ]

Produces

@@ -501,18 +502,18 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "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" ]
 }

Produces

@@ -552,9 +553,10 @@ font-style: italic;

Request body

-
body (required)
+
body Pet (required)
Body Parameter — Pet object that needs to be added to the store
+
@@ -677,9 +679,9 @@ font-style: italic;

Example data

Content-Type: application/json
{
+  "message" : "aeiou",
   "code" : 123,
-  "type" : "aeiou",
-  "message" : "aeiou"
+  "type" : "aeiou"
 }

Produces

@@ -816,12 +818,12 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "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"
 }

Produces

@@ -855,9 +857,10 @@ font-style: italic;

Request body

-
body (required)
+
body Order (required)
Body Parameter — order placed for purchasing the pet
+
@@ -884,12 +887,12 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "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"
 }

Produces

@@ -921,9 +924,10 @@ font-style: italic;

Request body

-
body (required)
+
body User (required)
Body Parameter — Created user object
+
@@ -958,9 +962,10 @@ font-style: italic;

Request body

-
body (required)
+
body User (required)
Body Parameter — List of user object
+
@@ -995,9 +1000,10 @@ font-style: italic;

Request body

-
body (required)
+
body User (required)
Body Parameter — List of user object
+
@@ -1103,14 +1109,14 @@ font-style: italic;

Example data

Content-Type: application/json
{
-  "firstName" : "aeiou",
-  "lastName" : "aeiou",
-  "password" : "aeiou",
-  "userStatus" : 123,
-  "phone" : "aeiou",
   "id" : 123456789,
+  "lastName" : "aeiou",
+  "phone" : "aeiou",
+  "username" : "aeiou",
   "email" : "aeiou",
-  "username" : "aeiou"
+  "userStatus" : 123,
+  "firstName" : "aeiou",
+  "password" : "aeiou"
 }

Produces

@@ -1234,9 +1240,10 @@ font-style: italic;

Request body

-
body (required)
+
body User (required)
Body Parameter — Updated user object
+