Add test cases to cover different collection formats (#3640)

* add test cases to cover different collection format

* add space params to retrofit 1.x

* add space params to retrofit 2.x

* rename url to localVarUrl

* fix exception in haskell servant
This commit is contained in:
William Cheng
2019-08-15 11:09:12 +08:00
committed by GitHub
parent 286cdfdfa2
commit c3535cf9ca
185 changed files with 8369 additions and 190 deletions

View File

@@ -191,6 +191,16 @@ public interface FakeApi {
}
@ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success") })
@RequestMapping(value = "/fake/test-query-paramters",
method = RequestMethod.PUT)
default Mono<ResponseEntity<Void>> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List<String> http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List<String> url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List<String> context, ServerWebExchange exchange) {
return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange);
}
@ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),

View File

@@ -218,6 +218,21 @@ public interface FakeApiDelegate {
}
/**
* @see FakeApi#testQueryParameterCollectionFormat
*/
default Mono<ResponseEntity<Void>> testQueryParameterCollectionFormat(List<String> pipe,
List<String> ioutil,
List<String> http,
List<String> url,
List<String> context,
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
}
/**
* @see FakeApi#uploadFileWithRequiredFile
*/

View File

@@ -1228,6 +1228,62 @@ paths:
x-accepts: application/json
x-tags:
- tag: fake
/fake/test-query-paramters:
put:
description: To test the collection format in query parameters
operationId: testQueryParameterCollectionFormat
parameters:
- explode: false
in: query
name: pipe
required: true
schema:
items:
type: string
type: array
style: form
- in: query
name: ioutil
required: true
schema:
items:
type: string
type: array
- in: query
name: http
required: true
schema:
items:
type: string
type: array
style: spaceDelimited
- explode: false
in: query
name: url
required: true
schema:
items:
type: string
type: array
style: form
- explode: true
in: query
name: context
required: true
schema:
items:
type: string
type: array
style: form
responses:
200:
content: {}
description: Success
tags:
- fake
x-accepts: application/json
x-tags:
- tag: fake
/fake/{petId}/uploadImageWithRequiredFile:
post:
operationId: uploadFileWithRequiredFile