forked from loafle/openapi-generator-original
use map/array model class only if it is generated (#17612)
* fix * tests * generate samples * refactor
This commit is contained in:
@@ -40,6 +40,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | |
|
||||
| [**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | |
|
||||
| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map |
|
||||
| [**testStringMapReferenceWithHttpInfo**](FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map |
|
||||
|
||||
|
||||
|
||||
@@ -2731,3 +2733,144 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
|
||||
## testStringMapReference
|
||||
|
||||
> CompletableFuture<Void> testStringMapReference(requestBody)
|
||||
|
||||
test referenced string map
|
||||
|
||||
|
||||
|
||||
### 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);
|
||||
Map<String, String> requestBody = new HashMap(); // Map<String, String> | request body
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testStringMapReference(requestBody);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testStringMapReference");
|
||||
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 |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **requestBody** | [**Map<String, String>**](String.md)| request body | |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
CompletableFuture<void> (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## testStringMapReferenceWithHttpInfo
|
||||
|
||||
> CompletableFuture<ApiResponse<Void>> testStringMapReference testStringMapReferenceWithHttpInfo(requestBody)
|
||||
|
||||
test referenced string map
|
||||
|
||||
|
||||
|
||||
### 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);
|
||||
Map<String, String> requestBody = new HashMap(); // Map<String, String> | request body
|
||||
try {
|
||||
CompletableFuture<ApiResponse<Void>> response = apiInstance.testStringMapReferenceWithHttpInfo(requestBody);
|
||||
System.out.println("Status code: " + response.get().getStatusCode());
|
||||
System.out.println("Response headers: " + response.get().getHeaders());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
ApiException apiException = (ApiException)e.getCause();
|
||||
System.err.println("Exception when calling FakeApi#testStringMapReference");
|
||||
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#testStringMapReference");
|
||||
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 |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **requestBody** | [**Map<String, String>**](String.md)| request body | |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
CompletableFuture<ApiResponse<Void>>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user