forked from loafle/openapi-generator-original
[python-nextgen] add support for StrictBytes (#15365)
* add strictbyte support in python-nextgen client * update samples * use union of strictbytes, strictstr for backward compatibility
This commit is contained in:
@@ -106,6 +106,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
|
||||
@@ -313,6 +313,28 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/body/application/octetstream/binary:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
operationId: test/body/application/octetstream/binary
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
format: binary
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test body parameter(s)
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/octet-stream
|
||||
x-accepts: text/plain
|
||||
/echo/body/Pet:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
|
||||
@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
@@ -74,6 +75,72 @@ No authorization required
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## testBodyApplicationOctetstreamBinary
|
||||
|
||||
> String testBodyApplicationOctetstreamBinary(body)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
BodyApi apiInstance = new BodyApi(defaultClient);
|
||||
File body = new File("/path/to/file"); // File |
|
||||
try {
|
||||
String result = apiInstance.testBodyApplicationOctetstreamBinary(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling BodyApi#testBodyApplicationOctetstreamBinary");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **body** | **File**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/octet-stream
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## testEchoBodyFreeFormObjectResponseString
|
||||
|
||||
> String testEchoBodyFreeFormObjectResponseString(body)
|
||||
|
||||
@@ -121,6 +121,75 @@ public class BodyApi {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testBodyApplicationOctetstreamBinary(File body) throws ApiException {
|
||||
return this.testBodyApplicationOctetstreamBinary(body, Collections.emptyMap());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @param additionalHeaders additionalHeaders for this call
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testBodyApplicationOctetstreamBinary(File body, Map<String, String> additionalHeaders) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/body/application/octetstream/binary";
|
||||
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
String localVarQueryParameterBaseName;
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/octet-stream"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
"POST",
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
localVarPostBody,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
localVarReturnType
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test free form object
|
||||
* Test free form object
|
||||
|
||||
@@ -313,6 +313,28 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/body/application/octetstream/binary:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
operationId: test/body/application/octetstream/binary
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
format: binary
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test body parameter(s)
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/octet-stream
|
||||
x-accepts: text/plain
|
||||
/echo/body/Pet:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
|
||||
@@ -43,6 +43,35 @@ public interface BodyApi extends ApiClient.Api {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /body/application/octetstream/binary")
|
||||
@Headers({
|
||||
"Content-Type: application/octet-stream",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testBodyApplicationOctetstreamBinary(File body);
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Similar to <code>testBodyApplicationOctetstreamBinary</code> but it also returns the http response headers .
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /body/application/octetstream/binary")
|
||||
@Headers({
|
||||
"Content-Type: application/octet-stream",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testBodyApplicationOctetstreamBinaryWithHttpInfo(File body);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test free form object
|
||||
* Test free form object
|
||||
|
||||
@@ -106,6 +106,8 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*BodyApi* | [**testBinaryGifWithHttpInfo**](docs/BodyApi.md#testBinaryGifWithHttpInfo) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*BodyApi* | [**testBodyApplicationOctetstreamBinaryWithHttpInfo**](docs/BodyApi.md#testBodyApplicationOctetstreamBinaryWithHttpInfo) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*BodyApi* | [**testEchoBodyFreeFormObjectResponseStringWithHttpInfo**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseStringWithHttpInfo) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
|
||||
@@ -313,6 +313,28 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/body/application/octetstream/binary:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
operationId: test/body/application/octetstream/binary
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
format: binary
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test body parameter(s)
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/octet-stream
|
||||
x-accepts: text/plain
|
||||
/echo/body/Pet:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
|
||||
@@ -6,6 +6,8 @@ All URIs are relative to *http://localhost:3000*
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**testBinaryGifWithHttpInfo**](BodyApi.md#testBinaryGifWithHttpInfo) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**testBodyApplicationOctetstreamBinaryWithHttpInfo**](BodyApi.md#testBodyApplicationOctetstreamBinaryWithHttpInfo) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**testEchoBodyFreeFormObjectResponseStringWithHttpInfo**](BodyApi.md#testEchoBodyFreeFormObjectResponseStringWithHttpInfo) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
@@ -143,6 +145,140 @@ No authorization required
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## testBodyApplicationOctetstreamBinary
|
||||
|
||||
> String testBodyApplicationOctetstreamBinary(body)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
BodyApi apiInstance = new BodyApi(defaultClient);
|
||||
File body = new File("/path/to/file"); // File |
|
||||
try {
|
||||
String result = apiInstance.testBodyApplicationOctetstreamBinary(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling BodyApi#testBodyApplicationOctetstreamBinary");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **body** | **File**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/octet-stream
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
## testBodyApplicationOctetstreamBinaryWithHttpInfo
|
||||
|
||||
> ApiResponse<String> testBodyApplicationOctetstreamBinary testBodyApplicationOctetstreamBinaryWithHttpInfo(body)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
BodyApi apiInstance = new BodyApi(defaultClient);
|
||||
File body = new File("/path/to/file"); // File |
|
||||
try {
|
||||
ApiResponse<String> response = apiInstance.testBodyApplicationOctetstreamBinaryWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders());
|
||||
System.out.println("Response body: " + response.getData());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling BodyApi#testBodyApplicationOctetstreamBinary");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **body** | **File**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**String**>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/octet-stream
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
|
||||
## testEchoBodyFreeFormObjectResponseString
|
||||
|
||||
> String testEchoBodyFreeFormObjectResponseString(body)
|
||||
|
||||
@@ -148,6 +148,87 @@ public class BodyApi {
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String testBodyApplicationOctetstreamBinary(File body) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = testBodyApplicationOctetstreamBinaryWithHttpInfo(body);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> testBodyApplicationOctetstreamBinaryWithHttpInfo(File body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testBodyApplicationOctetstreamBinaryRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
try {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw getApiException("testBodyApplicationOctetstreamBinary", localVarResponse);
|
||||
}
|
||||
// for plain text response
|
||||
if (localVarResponse.headers().map().containsKey("Content-Type") &&
|
||||
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0))) {
|
||||
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
|
||||
String responseBodyText = s.hasNext() ? s.next() : "";
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
responseBodyText
|
||||
);
|
||||
} else {
|
||||
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testBodyApplicationOctetstreamBinaryRequestBuilder(File body) throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/body/application/octetstream/binary";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/octet-stream");
|
||||
localVarRequestBuilder.header("Accept", "text/plain");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Test free form object
|
||||
* Test free form object
|
||||
|
||||
@@ -113,6 +113,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
|
||||
@@ -313,6 +313,28 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/body/application/octetstream/binary:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
operationId: test/body/application/octetstream/binary
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
format: binary
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test body parameter(s)
|
||||
tags:
|
||||
- body
|
||||
x-content-type: application/octet-stream
|
||||
x-accepts: text/plain
|
||||
/echo/body/Pet:
|
||||
post:
|
||||
description: Test body parameter(s)
|
||||
|
||||
@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost:3000*
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
@@ -69,6 +70,68 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
<a name="testBodyApplicationOctetstreamBinary"></a>
|
||||
# **testBodyApplicationOctetstreamBinary**
|
||||
> String testBodyApplicationOctetstreamBinary(body)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://localhost:3000");
|
||||
|
||||
BodyApi apiInstance = new BodyApi(defaultClient);
|
||||
File body = new File("/path/to/file"); // File |
|
||||
try {
|
||||
String result = apiInstance.testBodyApplicationOctetstreamBinary(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling BodyApi#testBodyApplicationOctetstreamBinary");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **body** | **File**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/octet-stream
|
||||
- **Accept**: text/plain
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
|
||||
<a name="testEchoBodyFreeFormObjectResponseString"></a>
|
||||
# **testEchoBodyFreeFormObjectResponseString**
|
||||
> String testEchoBodyFreeFormObjectResponseString(body)
|
||||
|
||||
@@ -188,6 +188,124 @@ public class BodyApi {
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyApplicationOctetstreamBinary
|
||||
* @param body (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testBodyApplicationOctetstreamBinaryCall(File body, final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
// Operation Servers
|
||||
String[] localBasePaths = new String[] { };
|
||||
|
||||
// Determine Base Path to Use
|
||||
if (localCustomBaseUrl != null){
|
||||
basePath = localCustomBaseUrl;
|
||||
} else if ( localBasePaths.length > 0 ) {
|
||||
basePath = localBasePaths[localHostIndex];
|
||||
} else {
|
||||
basePath = null;
|
||||
}
|
||||
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/body/application/octetstream/binary";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/octet-stream"
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarContentType != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testBodyApplicationOctetstreamBinaryValidateBeforeCall(File body, final ApiCallback _callback) throws ApiException {
|
||||
return testBodyApplicationOctetstreamBinaryCall(body, _callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return String
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public String testBodyApplicationOctetstreamBinary(File body) throws ApiException {
|
||||
ApiResponse<String> localVarResp = testBodyApplicationOctetstreamBinaryWithHttpInfo(body);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<String> testBodyApplicationOctetstreamBinaryWithHttpInfo(File body) throws ApiException {
|
||||
okhttp3.Call localVarCall = testBodyApplicationOctetstreamBinaryValidateBeforeCall(body, null);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test body parameter(s) (asynchronously)
|
||||
* Test body parameter(s)
|
||||
* @param body (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testBodyApplicationOctetstreamBinaryAsync(File body, final ApiCallback<String> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = testBodyApplicationOctetstreamBinaryValidateBeforeCall(body, _callback);
|
||||
Type localVarReturnType = new TypeToken<String>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for testEchoBodyFreeFormObjectResponseString
|
||||
* @param body Free form object (optional)
|
||||
|
||||
Reference in New Issue
Block a user