From 61cf01531cbebb56132ca0c421f38f47e9eb337e Mon Sep 17 00:00:00 2001 From: 00Kai0 Date: Mon, 29 Jun 2020 18:00:51 +0800 Subject: [PATCH] add examples --- swagger/body-boolean.json | 27 ++++++++++++++----- swagger/body-byte.json | 5 ++++ swagger/custom-baseUrl-paging.json | 10 +++++++ swagger/custom-baseUrl.json | 5 ++++ .../examples/Paging_getPagesPartialUrl.json | 20 ++++++++++++++ .../Paging_getPagesPartialUrlOperation.json | 20 ++++++++++++++ swagger/examples/bool_getFalse.json | 8 ++++++ swagger/examples/bool_getNull.json | 6 +++++ swagger/examples/bool_putFalse.json | 8 ++++++ swagger/examples/byte_getEmpty.json | 8 ++++++ swagger/examples/byte_getInvalid.json | 8 ++++++ swagger/examples/byte_getNonAscii.json | 8 ++++++ swagger/examples/byte_getNull.json | 6 +++++ swagger/examples/byte_putNonAscii.json | 8 ++++++ swagger/examples/paths_getEmpty.json | 10 +++++++ 15 files changed, 151 insertions(+), 6 deletions(-) create mode 100644 swagger/examples/Paging_getPagesPartialUrl.json create mode 100644 swagger/examples/Paging_getPagesPartialUrlOperation.json create mode 100644 swagger/examples/bool_getFalse.json create mode 100644 swagger/examples/bool_getNull.json create mode 100644 swagger/examples/bool_putFalse.json create mode 100644 swagger/examples/byte_getEmpty.json create mode 100644 swagger/examples/byte_getInvalid.json create mode 100644 swagger/examples/byte_getNonAscii.json create mode 100644 swagger/examples/byte_getNull.json create mode 100644 swagger/examples/byte_putNonAscii.json create mode 100644 swagger/examples/paths_getEmpty.json diff --git a/swagger/body-boolean.json b/swagger/body-boolean.json index 6ef4aed7..2f580318 100644 --- a/swagger/body-boolean.json +++ b/swagger/body-boolean.json @@ -17,9 +17,9 @@ "operationId": "bool_getTrue", "description": "Get true Boolean value", "x-ms-examples": { - "bool_getTrue": { - "$ref": "./examples/bool_getTrue.json" - } + "bool_getTrue": { + "$ref": "./examples/bool_getTrue.json" + } }, "tags": [ "Bool Operations" @@ -44,9 +44,9 @@ "operationId": "bool_putTrue", "description": "Set Boolean value true", "x-ms-examples": { - "bool_putTrue": { - "$ref": "./examples/bool_putTrue.json" - } + "bool_putTrue": { + "$ref": "./examples/bool_putTrue.json" + } }, "parameters": [ { @@ -79,6 +79,11 @@ "get": { "operationId": "bool_getFalse", "description": "Get false Boolean value", + "x-ms-examples": { + "bool_getFalse": { + "$ref": "./examples/bool_getFalse.json" + } + }, "tags": [ "Bool Operations" ], @@ -101,6 +106,11 @@ "put": { "operationId": "bool_putFalse", "description": "Set Boolean value false", + "x-ms-examples": { + "bool_putFalse": { + "$ref": "./examples/bool_putFalse.json" + } + }, "parameters": [ { "name": "boolBody", @@ -132,6 +142,11 @@ "get": { "operationId": "bool_getNull", "description": "Get null Boolean value", + "x-ms-examples": { + "bool_getNull": { + "$ref": "./examples/bool_getNull.json" + } + }, "tags": [ "Bool Operations" ], diff --git a/swagger/body-byte.json b/swagger/body-byte.json index 7bd90f4f..8a75749a 100644 --- a/swagger/body-byte.json +++ b/swagger/body-byte.json @@ -16,6 +16,11 @@ "get": { "operationId": "byte_getNull", "description": "Get null byte value", + "x-ms-examples": { + "byte_getNull": { + "$ref": "./examples/byte_getNull.json" + } + }, "tags": [ "Byte Operations" ], diff --git a/swagger/custom-baseUrl-paging.json b/swagger/custom-baseUrl-paging.json index 9449e236..a9ec7502 100644 --- a/swagger/custom-baseUrl-paging.json +++ b/swagger/custom-baseUrl-paging.json @@ -30,6 +30,11 @@ "get": { "operationId": "Paging_getPagesPartialUrl", "description": "A paging operation that combines custom url, paging and partial URL and expect to concat after host", + "x-ms-examples": { + "Paging_getPagesPartialUrl": { + "$ref": "./examples/Paging_getPagesPartialUrl.json" + } + }, "responses": { "200": { "description": "Paging response with a fragment nextLink", @@ -51,6 +56,11 @@ "get": { "operationId": "Paging_getPagesPartialUrlOperation", "description": "A paging operation that combines custom url, paging and partial URL with next operation", + "x-ms-examples": { + "Paging_getPagesPartialUrlOperation": { + "$ref": "./examples/Paging_getPagesPartialUrlOperation.json" + } + }, "responses": { "200": { "description": "Paging response with a fragment nextLink", diff --git a/swagger/custom-baseUrl.json b/swagger/custom-baseUrl.json index 7223cd5f..6e34a2db 100644 --- a/swagger/custom-baseUrl.json +++ b/swagger/custom-baseUrl.json @@ -30,6 +30,11 @@ "get": { "operationId": "paths_getEmpty", "description": "Get a 200 to test a valid base uri", + "x-ms-examples": { + "paths_getEmpty": { + "$ref": "./examples/paths_getEmpty.json" + } + }, "tags": [ "Path Operations" ], diff --git a/swagger/examples/Paging_getPagesPartialUrl.json b/swagger/examples/Paging_getPagesPartialUrl.json new file mode 100644 index 00000000..a46f65e3 --- /dev/null +++ b/swagger/examples/Paging_getPagesPartialUrl.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "accountName": "testaccount" + }, + "responses": { + "200": { + "body": { + "values":[ + { + "properties":{ + "id":1, + "name":"Product" + } + } + ], + "nextLink":"/paging/customurl/partialnextlink/page/2" + } + } + } +} \ No newline at end of file diff --git a/swagger/examples/Paging_getPagesPartialUrlOperation.json b/swagger/examples/Paging_getPagesPartialUrlOperation.json new file mode 100644 index 00000000..3680da81 --- /dev/null +++ b/swagger/examples/Paging_getPagesPartialUrlOperation.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "accountName": "testaccount" + }, + "responses": { + "200": { + "body": { + "values":[ + { + "properties":{ + "id":1, + "name":"Product" + } + } + ], + "nextLink":"partialnextlinkop/page/2" + } + } + } +} \ No newline at end of file diff --git a/swagger/examples/bool_getFalse.json b/swagger/examples/bool_getFalse.json new file mode 100644 index 00000000..0bc3b35e --- /dev/null +++ b/swagger/examples/bool_getFalse.json @@ -0,0 +1,8 @@ +{ + "parameters": {}, + "responses": { + "200": { + "body": false + } + } +} \ No newline at end of file diff --git a/swagger/examples/bool_getNull.json b/swagger/examples/bool_getNull.json new file mode 100644 index 00000000..e24179d1 --- /dev/null +++ b/swagger/examples/bool_getNull.json @@ -0,0 +1,6 @@ +{ + "parameters": {}, + "responses": { + "200": {} + } +} \ No newline at end of file diff --git a/swagger/examples/bool_putFalse.json b/swagger/examples/bool_putFalse.json new file mode 100644 index 00000000..ab9238e5 --- /dev/null +++ b/swagger/examples/bool_putFalse.json @@ -0,0 +1,8 @@ +{ + "parameters": { + "boolBody": false + }, + "responses": { + "200": {} + } +} \ No newline at end of file diff --git a/swagger/examples/byte_getEmpty.json b/swagger/examples/byte_getEmpty.json new file mode 100644 index 00000000..2b04d0f8 --- /dev/null +++ b/swagger/examples/byte_getEmpty.json @@ -0,0 +1,8 @@ +{ + "parameters": {}, + "responses": { + "200": { + "body": "" + } + } +} \ No newline at end of file diff --git a/swagger/examples/byte_getInvalid.json b/swagger/examples/byte_getInvalid.json new file mode 100644 index 00000000..f47ede11 --- /dev/null +++ b/swagger/examples/byte_getInvalid.json @@ -0,0 +1,8 @@ +{ + "parameters": {}, + "responses": { + "200": { + "body": "::::SWAGGER::::" + } + } +} \ No newline at end of file diff --git a/swagger/examples/byte_getNonAscii.json b/swagger/examples/byte_getNonAscii.json new file mode 100644 index 00000000..4fe17d43 --- /dev/null +++ b/swagger/examples/byte_getNonAscii.json @@ -0,0 +1,8 @@ +{ + "parameters": {}, + "responses": { + "200": { + "body": "//79/Pv6+fj39g==" + } + } +} \ No newline at end of file diff --git a/swagger/examples/byte_getNull.json b/swagger/examples/byte_getNull.json new file mode 100644 index 00000000..e24179d1 --- /dev/null +++ b/swagger/examples/byte_getNull.json @@ -0,0 +1,6 @@ +{ + "parameters": {}, + "responses": { + "200": {} + } +} \ No newline at end of file diff --git a/swagger/examples/byte_putNonAscii.json b/swagger/examples/byte_putNonAscii.json new file mode 100644 index 00000000..367268e0 --- /dev/null +++ b/swagger/examples/byte_putNonAscii.json @@ -0,0 +1,8 @@ +{ + "parameters": { + "byteBody": "//79/Pv6+fj39g==" + }, + "responses": { + "200": {} + } +} \ No newline at end of file diff --git a/swagger/examples/paths_getEmpty.json b/swagger/examples/paths_getEmpty.json new file mode 100644 index 00000000..2c392e9a --- /dev/null +++ b/swagger/examples/paths_getEmpty.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "accountName": "testaccount" + }, + "responses": { + "200": { + "body": "" + } + } +} \ No newline at end of file