[Golang][client] fix formData file parameter name use (#506)

* support form-data file MIME `name` parameter

* update test spec and Go client for form-data file name

* update samples for ensure-up-to-date

* update mustache template

* update samples for Go client

* improve assignment location

* update samples
This commit is contained in:
John Wang
2018-07-12 11:53:38 -05:00
committed by William Cheng
parent 93832340a5
commit 19fd48e33b
101 changed files with 536 additions and 489 deletions

View File

@@ -237,7 +237,7 @@ public interface FakeApi {
produces = { "application/json" },
consumes = { "multipart/form-data" },
method = RequestMethod.POST)
default ResponseEntity<Mono<ModelApiResponse>> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, ServerWebExchange exchange) {
default ResponseEntity<Mono<ModelApiResponse>> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, ServerWebExchange exchange) {
Mono<ModelApiResponse> result = Mono.empty();
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {

View File

@@ -1129,12 +1129,12 @@ paths:
additionalMetadata:
description: Additional data to pass to server
type: string
file:
requiredFile:
description: file to upload
format: binary
type: string
required:
- file
- requiredFile
required: true
responses:
200:
@@ -1634,6 +1634,7 @@ components:
$ref: '#/components/schemas/Animal'
type: array
File:
description: Must be named `File` for test.
example:
sourceURI: sourceURI
properties: