forked from loafle/openapi-generator-original
Use unescaped media type in java native client (#17872)
* use unescaped media type in java native client * add tests
This commit is contained in:
@@ -424,9 +424,9 @@ public class {{classname}} {
|
|||||||
}
|
}
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
{{#bodyParam}}
|
{{#bodyParam}}
|
||||||
localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{mediaType}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}");
|
localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}");
|
||||||
{{/bodyParam}}
|
{{/bodyParam}}
|
||||||
localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}");
|
localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}");
|
||||||
|
|
||||||
{{#bodyParam}}
|
{{#bodyParam}}
|
||||||
{{#isString}}
|
{{#isString}}
|
||||||
|
|||||||
@@ -1188,6 +1188,19 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ArrayOfEnums'
|
$ref: '#/components/schemas/ArrayOfEnums'
|
||||||
|
/fake/application_json_utf8:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
|
summary: application/json UTF8
|
||||||
|
operationId: get_application_json_utf8
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: test
|
||||||
|
content:
|
||||||
|
application/json;charset=utf-8:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ArrayOfEnums'
|
||||||
servers:
|
servers:
|
||||||
- url: 'http://{server}.swagger.io:{port}/v2'
|
- url: 'http://{server}.swagger.io:{port}/v2'
|
||||||
description: petstore server
|
description: petstore server
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ Class | Method | HTTP request | Description
|
|||||||
*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number |
|
*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number |
|
||||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||||
*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string |
|
*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string |
|
||||||
|
*FakeApi* | [**getApplicationJsonUtf8**](docs/FakeApi.md#getApplicationJsonUtf8) | **GET** /fake/application_json_utf8 | application/json UTF8
|
||||||
|
*FakeApi* | [**getApplicationJsonUtf8WithHttpInfo**](docs/FakeApi.md#getApplicationJsonUtf8WithHttpInfo) | **GET** /fake/application_json_utf8 | application/json UTF8
|
||||||
*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
|
*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
|
||||||
*FakeApi* | [**getArrayOfEnumsWithHttpInfo**](docs/FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums
|
*FakeApi* | [**getArrayOfEnumsWithHttpInfo**](docs/FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums
|
||||||
*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
|
*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
|
||||||
|
|||||||
@@ -1208,6 +1208,20 @@ paths:
|
|||||||
tags:
|
tags:
|
||||||
- fake
|
- fake
|
||||||
x-accepts: application/json
|
x-accepts: application/json
|
||||||
|
/fake/application_json_utf8:
|
||||||
|
get:
|
||||||
|
operationId: get_application_json_utf8
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json;charset=utf-8:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ArrayOfEnums'
|
||||||
|
description: test
|
||||||
|
summary: application/json UTF8
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
|
x-accepts: application/json;charset=utf-8
|
||||||
components:
|
components:
|
||||||
requestBodies:
|
requestBodies:
|
||||||
UserArray:
|
UserArray:
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
|||||||
| [**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | |
|
| [**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | |
|
||||||
| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
|
| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
|
||||||
| [**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | |
|
| [**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | |
|
||||||
|
| [**getApplicationJsonUtf8**](FakeApi.md#getApplicationJsonUtf8) | **GET** /fake/application_json_utf8 | application/json UTF8 |
|
||||||
|
| [**getApplicationJsonUtf8WithHttpInfo**](FakeApi.md#getApplicationJsonUtf8WithHttpInfo) | **GET** /fake/application_json_utf8 | application/json UTF8 |
|
||||||
| [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums |
|
| [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums |
|
||||||
| [**getArrayOfEnumsWithHttpInfo**](FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums |
|
| [**getArrayOfEnumsWithHttpInfo**](FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums |
|
||||||
| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties |
|
| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties |
|
||||||
@@ -883,6 +885,137 @@ No authorization required
|
|||||||
| **200** | Output string | - |
|
| **200** | Output string | - |
|
||||||
|
|
||||||
|
|
||||||
|
## getApplicationJsonUtf8
|
||||||
|
|
||||||
|
> CompletableFuture<List<OuterEnum>> getApplicationJsonUtf8()
|
||||||
|
|
||||||
|
application/json UTF8
|
||||||
|
|
||||||
|
### 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.FakeApi;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class Example {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||||
|
try {
|
||||||
|
CompletableFuture<List<OuterEnum>> result = apiInstance.getApplicationJsonUtf8();
|
||||||
|
System.out.println(result.get());
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#getApplicationJsonUtf8");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
CompletableFuture<[**List<OuterEnum>**](OuterEnum.md)>
|
||||||
|
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json;charset=utf-8
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | test | - |
|
||||||
|
|
||||||
|
## getApplicationJsonUtf8WithHttpInfo
|
||||||
|
|
||||||
|
> CompletableFuture<ApiResponse<List<OuterEnum>>> getApplicationJsonUtf8 getApplicationJsonUtf8WithHttpInfo()
|
||||||
|
|
||||||
|
application/json UTF8
|
||||||
|
|
||||||
|
### 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.FakeApi;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class Example {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||||
|
try {
|
||||||
|
CompletableFuture<ApiResponse<List<OuterEnum>>> response = apiInstance.getApplicationJsonUtf8WithHttpInfo();
|
||||||
|
System.out.println("Status code: " + response.get().getStatusCode());
|
||||||
|
System.out.println("Response headers: " + response.get().getHeaders());
|
||||||
|
System.out.println("Response body: " + response.get().getData());
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
ApiException apiException = (ApiException)e.getCause();
|
||||||
|
System.err.println("Exception when calling FakeApi#getApplicationJsonUtf8");
|
||||||
|
System.err.println("Status code: " + apiException.getCode());
|
||||||
|
System.err.println("Response headers: " + apiException.getResponseHeaders());
|
||||||
|
System.err.println("Reason: " + apiException.getResponseBody());
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#getApplicationJsonUtf8");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
CompletableFuture<ApiResponse<[**List<OuterEnum>**](OuterEnum.md)>>
|
||||||
|
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json;charset=utf-8
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | test | - |
|
||||||
|
|
||||||
|
|
||||||
## getArrayOfEnums
|
## getArrayOfEnums
|
||||||
|
|
||||||
> CompletableFuture<List<OuterEnum>> getArrayOfEnums()
|
> CompletableFuture<List<OuterEnum>> getArrayOfEnums()
|
||||||
|
|||||||
@@ -642,6 +642,92 @@ public class FakeApi {
|
|||||||
}
|
}
|
||||||
return localVarRequestBuilder;
|
return localVarRequestBuilder;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* application/json UTF8
|
||||||
|
*
|
||||||
|
* @return CompletableFuture<List<OuterEnum>>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public CompletableFuture<List<OuterEnum>> getApplicationJsonUtf8() throws ApiException {
|
||||||
|
try {
|
||||||
|
HttpRequest.Builder localVarRequestBuilder = getApplicationJsonUtf8RequestBuilder();
|
||||||
|
return memberVarHttpClient.sendAsync(
|
||||||
|
localVarRequestBuilder.build(),
|
||||||
|
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||||
|
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||||
|
return CompletableFuture.failedFuture(getApiException("getApplicationJsonUtf8", localVarResponse));
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String responseBody = localVarResponse.body();
|
||||||
|
return CompletableFuture.completedFuture(
|
||||||
|
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<List<OuterEnum>>() {})
|
||||||
|
);
|
||||||
|
} catch (IOException e) {
|
||||||
|
return CompletableFuture.failedFuture(new ApiException(e));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (ApiException e) {
|
||||||
|
return CompletableFuture.failedFuture(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* application/json UTF8
|
||||||
|
*
|
||||||
|
* @return CompletableFuture<ApiResponse<List<OuterEnum>>>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public CompletableFuture<ApiResponse<List<OuterEnum>>> getApplicationJsonUtf8WithHttpInfo() throws ApiException {
|
||||||
|
try {
|
||||||
|
HttpRequest.Builder localVarRequestBuilder = getApplicationJsonUtf8RequestBuilder();
|
||||||
|
return memberVarHttpClient.sendAsync(
|
||||||
|
localVarRequestBuilder.build(),
|
||||||
|
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||||
|
if (memberVarAsyncResponseInterceptor != null) {
|
||||||
|
memberVarAsyncResponseInterceptor.accept(localVarResponse);
|
||||||
|
}
|
||||||
|
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||||
|
return CompletableFuture.failedFuture(getApiException("getApplicationJsonUtf8", localVarResponse));
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String responseBody = localVarResponse.body();
|
||||||
|
return CompletableFuture.completedFuture(
|
||||||
|
new ApiResponse<List<OuterEnum>>(
|
||||||
|
localVarResponse.statusCode(),
|
||||||
|
localVarResponse.headers().map(),
|
||||||
|
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<List<OuterEnum>>() {}))
|
||||||
|
);
|
||||||
|
} catch (IOException e) {
|
||||||
|
return CompletableFuture.failedFuture(new ApiException(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (ApiException e) {
|
||||||
|
return CompletableFuture.failedFuture(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpRequest.Builder getApplicationJsonUtf8RequestBuilder() throws ApiException {
|
||||||
|
|
||||||
|
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||||
|
|
||||||
|
String localVarPath = "/fake/application_json_utf8";
|
||||||
|
|
||||||
|
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||||
|
|
||||||
|
localVarRequestBuilder.header("Accept", "application/json;charset=utf-8");
|
||||||
|
|
||||||
|
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||||
|
if (memberVarReadTimeout != null) {
|
||||||
|
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||||
|
}
|
||||||
|
if (memberVarInterceptor != null) {
|
||||||
|
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||||
|
}
|
||||||
|
return localVarRequestBuilder;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Array of Enums
|
* Array of Enums
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ Class | Method | HTTP request | Description
|
|||||||
*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number |
|
*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number |
|
||||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||||
*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string |
|
*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string |
|
||||||
|
*FakeApi* | [**getApplicationJsonUtf8**](docs/FakeApi.md#getApplicationJsonUtf8) | **GET** /fake/application_json_utf8 | application/json UTF8
|
||||||
|
*FakeApi* | [**getApplicationJsonUtf8WithHttpInfo**](docs/FakeApi.md#getApplicationJsonUtf8WithHttpInfo) | **GET** /fake/application_json_utf8 | application/json UTF8
|
||||||
*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
|
*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
|
||||||
*FakeApi* | [**getArrayOfEnumsWithHttpInfo**](docs/FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums
|
*FakeApi* | [**getArrayOfEnumsWithHttpInfo**](docs/FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums
|
||||||
*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
|
*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
|
||||||
|
|||||||
@@ -1208,6 +1208,20 @@ paths:
|
|||||||
tags:
|
tags:
|
||||||
- fake
|
- fake
|
||||||
x-accepts: application/json
|
x-accepts: application/json
|
||||||
|
/fake/application_json_utf8:
|
||||||
|
get:
|
||||||
|
operationId: get_application_json_utf8
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json;charset=utf-8:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ArrayOfEnums'
|
||||||
|
description: test
|
||||||
|
summary: application/json UTF8
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
|
x-accepts: application/json;charset=utf-8
|
||||||
components:
|
components:
|
||||||
requestBodies:
|
requestBodies:
|
||||||
UserArray:
|
UserArray:
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
|||||||
| [**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | |
|
| [**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | |
|
||||||
| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
|
| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
|
||||||
| [**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | |
|
| [**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | |
|
||||||
|
| [**getApplicationJsonUtf8**](FakeApi.md#getApplicationJsonUtf8) | **GET** /fake/application_json_utf8 | application/json UTF8 |
|
||||||
|
| [**getApplicationJsonUtf8WithHttpInfo**](FakeApi.md#getApplicationJsonUtf8WithHttpInfo) | **GET** /fake/application_json_utf8 | application/json UTF8 |
|
||||||
| [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums |
|
| [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums |
|
||||||
| [**getArrayOfEnumsWithHttpInfo**](FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums |
|
| [**getArrayOfEnumsWithHttpInfo**](FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums |
|
||||||
| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties |
|
| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties |
|
||||||
@@ -829,6 +831,128 @@ No authorization required
|
|||||||
| **200** | Output string | - |
|
| **200** | Output string | - |
|
||||||
|
|
||||||
|
|
||||||
|
## getApplicationJsonUtf8
|
||||||
|
|
||||||
|
> List<OuterEnum> getApplicationJsonUtf8()
|
||||||
|
|
||||||
|
application/json UTF8
|
||||||
|
|
||||||
|
### 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.FakeApi;
|
||||||
|
|
||||||
|
public class Example {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||||
|
try {
|
||||||
|
List<OuterEnum> result = apiInstance.getApplicationJsonUtf8();
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeApi#getApplicationJsonUtf8");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<OuterEnum>**](OuterEnum.md)
|
||||||
|
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json;charset=utf-8
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | test | - |
|
||||||
|
|
||||||
|
## getApplicationJsonUtf8WithHttpInfo
|
||||||
|
|
||||||
|
> ApiResponse<List<OuterEnum>> getApplicationJsonUtf8 getApplicationJsonUtf8WithHttpInfo()
|
||||||
|
|
||||||
|
application/json UTF8
|
||||||
|
|
||||||
|
### 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.FakeApi;
|
||||||
|
|
||||||
|
public class Example {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||||
|
try {
|
||||||
|
ApiResponse<List<OuterEnum>> response = apiInstance.getApplicationJsonUtf8WithHttpInfo();
|
||||||
|
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 FakeApi#getApplicationJsonUtf8");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
ApiResponse<[**List<OuterEnum>**](OuterEnum.md)>
|
||||||
|
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json;charset=utf-8
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | test | - |
|
||||||
|
|
||||||
|
|
||||||
## getArrayOfEnums
|
## getArrayOfEnums
|
||||||
|
|
||||||
> List<OuterEnum> getArrayOfEnums()
|
> List<OuterEnum> getArrayOfEnums()
|
||||||
|
|||||||
@@ -515,6 +515,71 @@ public class FakeApi {
|
|||||||
}
|
}
|
||||||
return localVarRequestBuilder;
|
return localVarRequestBuilder;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* application/json UTF8
|
||||||
|
*
|
||||||
|
* @return List<OuterEnum>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public List<OuterEnum> getApplicationJsonUtf8() throws ApiException {
|
||||||
|
ApiResponse<List<OuterEnum>> localVarResponse = getApplicationJsonUtf8WithHttpInfo();
|
||||||
|
return localVarResponse.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* application/json UTF8
|
||||||
|
*
|
||||||
|
* @return ApiResponse<List<OuterEnum>>
|
||||||
|
* @throws ApiException if fails to make API call
|
||||||
|
*/
|
||||||
|
public ApiResponse<List<OuterEnum>> getApplicationJsonUtf8WithHttpInfo() throws ApiException {
|
||||||
|
HttpRequest.Builder localVarRequestBuilder = getApplicationJsonUtf8RequestBuilder();
|
||||||
|
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("getApplicationJsonUtf8", localVarResponse);
|
||||||
|
}
|
||||||
|
return new ApiResponse<List<OuterEnum>>(
|
||||||
|
localVarResponse.statusCode(),
|
||||||
|
localVarResponse.headers().map(),
|
||||||
|
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<OuterEnum>>() {}) // closes the InputStream
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new ApiException(e);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
throw new ApiException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpRequest.Builder getApplicationJsonUtf8RequestBuilder() throws ApiException {
|
||||||
|
|
||||||
|
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||||
|
|
||||||
|
String localVarPath = "/fake/application_json_utf8";
|
||||||
|
|
||||||
|
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||||
|
|
||||||
|
localVarRequestBuilder.header("Accept", "application/json;charset=utf-8");
|
||||||
|
|
||||||
|
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||||
|
if (memberVarReadTimeout != null) {
|
||||||
|
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||||
|
}
|
||||||
|
if (memberVarInterceptor != null) {
|
||||||
|
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||||
|
}
|
||||||
|
return localVarRequestBuilder;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Array of Enums
|
* Array of Enums
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user