forked from loafle/openapi-generator-original
Add top level x-group-parameters support (#1405)
* add top level x-group-parameters support * update petstore samples
This commit is contained in:
@@ -470,7 +470,7 @@ No authorization required
|
||||
|
||||
<a name="testGroupParameters"></a>
|
||||
# **testGroupParameters**
|
||||
> testGroupParameters(stringGroup, booleanGroup, int64Group)
|
||||
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
@@ -484,11 +484,14 @@ Fake endpoint to test group parameters (optional)
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
Integer requiredStringGroup = 56; // Integer | Required String in group parameters
|
||||
Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters
|
||||
Long requiredInt64Group = 56L; // Long | Required Integer in group parameters
|
||||
Integer stringGroup = 56; // Integer | String in group parameters
|
||||
Boolean booleanGroup = true; // Boolean | Boolean in group parameters
|
||||
Long int64Group = 56L; // Long | Integer in group parameters
|
||||
try {
|
||||
apiInstance.testGroupParameters(stringGroup, booleanGroup, int64Group);
|
||||
apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testGroupParameters");
|
||||
e.printStackTrace();
|
||||
@@ -499,6 +502,9 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requiredStringGroup** | **Integer**| Required String in group parameters |
|
||||
**requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
|
||||
**requiredInt64Group** | **Long**| Required Integer in group parameters |
|
||||
**stringGroup** | **Integer**| String in group parameters | [optional]
|
||||
**booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
|
||||
**int64Group** | **Long**| Integer in group parameters | [optional]
|
||||
|
||||
@@ -425,23 +425,45 @@ public class FakeApi {
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
* <p><b>400</b> - Someting wrong
|
||||
* @param requiredStringGroup Required String in group parameters
|
||||
* @param requiredBooleanGroup Required Boolean in group parameters
|
||||
* @param requiredInt64Group Required Integer in group parameters
|
||||
* @param stringGroup String in group parameters
|
||||
* @param booleanGroup Boolean in group parameters
|
||||
* @param int64Group Integer in group parameters
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException {
|
||||
public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
// verify the required parameter 'requiredStringGroup' is set
|
||||
if (requiredStringGroup == null) {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
|
||||
}
|
||||
|
||||
// verify the required parameter 'requiredBooleanGroup' is set
|
||||
if (requiredBooleanGroup == null) {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");
|
||||
}
|
||||
|
||||
// verify the required parameter 'requiredInt64Group' is set
|
||||
if (requiredInt64Group == null) {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
|
||||
}
|
||||
|
||||
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup));
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group));
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup));
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group));
|
||||
|
||||
if (requiredBooleanGroup != null)
|
||||
headerParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup));
|
||||
if (booleanGroup != null)
|
||||
headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup));
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ package org.openapitools.client.api;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@@ -101,6 +102,22 @@ public class FakeApiTest {
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testBodyWithFileSchemaTest() {
|
||||
FileSchemaTestClass fileSchemaTestClass = null;
|
||||
api.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -186,6 +203,27 @@ public class FakeApiTest {
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
*
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testGroupParametersTest() {
|
||||
Integer requiredStringGroup = null;
|
||||
Boolean requiredBooleanGroup = null;
|
||||
Long requiredInt64Group = null;
|
||||
Integer stringGroup = null;
|
||||
Boolean booleanGroup = null;
|
||||
Long int64Group = null;
|
||||
api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user