mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 11:56:10 +00:00
Merge remote-tracking branch 'origin/master' into 7.0.x
This commit is contained in:
@@ -159,9 +159,12 @@ Class | Method | HTTP request | Description
|
||||
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
<a id="api_key"></a>
|
||||
### api_key
|
||||
|
||||
|
||||
@@ -169,6 +172,7 @@ Authentication schemes defined for the API:
|
||||
- **API key parameter name**: X-Api-Key
|
||||
- **Location**: HTTP header
|
||||
|
||||
<a id="api_key_query"></a>
|
||||
### api_key_query
|
||||
|
||||
|
||||
|
||||
@@ -807,7 +807,17 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
File file = (File) param.getValue();
|
||||
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
|
||||
.fileName(file.getName()).size(file.length()).build();
|
||||
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
|
||||
|
||||
// Attempt to probe the content type for the file so that the form part is more correctly
|
||||
// and precisely identified, but fall back to application/octet-stream if that fails.
|
||||
MediaType type;
|
||||
try {
|
||||
type = MediaType.valueOf(Files.probeContentType(file.toPath()));
|
||||
} catch (IOException | IllegalArgumentException e) {
|
||||
type = MediaType.APPLICATION_OCTET_STREAM_TYPE;
|
||||
}
|
||||
|
||||
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type));
|
||||
} else {
|
||||
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
|
||||
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
|
||||
|
||||
@@ -15,6 +15,8 @@ package org.openapitools.client;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Configuration {
|
||||
public static final String VERSION = "1.0.0";
|
||||
|
||||
private static ApiClient defaultApiClient = new ApiClient();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user