-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix request path and query params' example support. (#247)
Fix request path and query params' example support.
- Loading branch information
Showing
5 changed files
with
261 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
src/test/resources/component/path_operation_with_path_param_example.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
|
||
[[_getpetbyid]] | ||
=== Find pet by ID | ||
.... | ||
GET /pets/{petId} | ||
.... | ||
|
||
|
||
==== Description | ||
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions | ||
|
||
|
||
==== Parameters | ||
|
||
[options="header", cols=".^2,.^3,.^9,.^4"] | ||
|=== | ||
|Type|Name|Description|Schema | ||
|**Path**|**petId** + | ||
__required__|ID of pet that needs to be fetched|integer (int64) | ||
|=== | ||
|
||
|
||
==== Responses | ||
|
||
[options="header", cols=".^2,.^14,.^4"] | ||
|=== | ||
|HTTP Code|Description|Schema | ||
|**200**|successful operation + | ||
**Headers** : + | ||
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. + | ||
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. + | ||
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|<<_pet,Pet>> | ||
|**400**|Invalid ID supplied|No Content | ||
|**404**|Pet not found|No Content | ||
|=== | ||
|
||
|
||
==== Produces | ||
|
||
* `application/json` | ||
* `application/xml` | ||
|
||
|
||
==== Tags | ||
|
||
* pet | ||
|
||
|
||
==== Security | ||
|
||
[options="header", cols=".^3,.^4,.^13"] | ||
|=== | ||
|Type|Name|Scopes | ||
|**apiKey**|**<<_api_key,api_key>>**| | ||
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets | ||
|=== | ||
|
||
|
||
==== Example HTTP request | ||
|
||
===== Request path | ||
---- | ||
/pets/30 | ||
---- | ||
|
||
|
||
==== Example HTTP response | ||
|
||
===== Response 200 | ||
[source,json] | ||
---- | ||
{ | ||
"id" : 0, | ||
"category" : { | ||
"id" : 0, | ||
"name" : "FoobarCategory" | ||
}, | ||
"name" : "doggie", | ||
"photoUrls" : [ "string" ], | ||
"tags" : [ { | ||
"id" : 0, | ||
"name" : "string" | ||
} ], | ||
"status" : "string" | ||
} | ||
---- | ||
|
||
|
||
|
96 changes: 96 additions & 0 deletions
96
src/test/resources/component/path_operation_with_query_param_example.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
[[_findpetsbytags]] | ||
=== Finds Pets by tags | ||
.... | ||
GET /pets/findByTags | ||
.... | ||
|
||
|
||
==== Description | ||
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. | ||
|
||
|
||
==== Parameters | ||
|
||
[options="header", cols=".^2,.^3,.^9,.^4"] | ||
|=== | ||
|Type|Name|Description|Schema | ||
|**Query**|**tags** + | ||
__optional__|Tags to filter by|< string > array(multi) | ||
|=== | ||
|
||
|
||
==== Responses | ||
|
||
[options="header", cols=".^2,.^14,.^4"] | ||
|=== | ||
|HTTP Code|Description|Schema | ||
|**200**|successful operation + | ||
**Headers** : + | ||
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. + | ||
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. + | ||
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|< <<_pet,Pet>> > array | ||
|**400**|Invalid tag value|No Content | ||
|=== | ||
|
||
|
||
==== Produces | ||
|
||
* `application/json` | ||
* `application/xml` | ||
|
||
|
||
==== Tags | ||
|
||
* pet | ||
|
||
|
||
==== Security | ||
|
||
[options="header", cols=".^3,.^4,.^13"] | ||
|=== | ||
|Type|Name|Scopes | ||
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets | ||
|=== | ||
|
||
|
||
==== Example HTTP request | ||
|
||
===== Request path | ||
---- | ||
/pets/findByTags | ||
---- | ||
|
||
|
||
===== Request query | ||
[source,json] | ||
---- | ||
{ | ||
"tags" : "adorable" | ||
} | ||
---- | ||
|
||
|
||
==== Example HTTP response | ||
|
||
===== Response 200 | ||
[source,json] | ||
---- | ||
[ { | ||
"id" : 0, | ||
"category" : { | ||
"id" : 0, | ||
"name" : "FoobarCategory" | ||
}, | ||
"name" : "doggie", | ||
"photoUrls" : [ "string" ], | ||
"tags" : [ { | ||
"id" : 0, | ||
"name" : "string" | ||
} ], | ||
"status" : "string" | ||
} ] | ||
---- | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters