Add top level x-group-parameters support (#1405)

* add top level x-group-parameters support

* update petstore samples
This commit is contained in:
William Cheng
2018-11-12 14:25:32 +08:00
committed by GitHub
parent 69a766882d
commit c7349c7f88
127 changed files with 1762 additions and 202 deletions

View File

@@ -587,27 +587,48 @@ if (enumFormString != null)
/**
* Fake endpoint to test group parameters (optional)
* Fake endpoint to test group parameters (optional)
* @param requiredStringGroup Required String in group parameters (required)
* @param requiredBooleanGroup Required Boolean in group parameters (required)
* @param requiredInt64Group Required Integer in group parameters (required)
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @throws ApiException if fails to make API call
*/
public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {
public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {
testGroupParametersWithHttpInfo(stringGroup, booleanGroup, int64Group);
testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
}
/**
* Fake endpoint to test group parameters (optional)
* Fake endpoint to test group parameters (optional)
* @param requiredStringGroup Required String in group parameters (required)
* @param requiredBooleanGroup Required Boolean in group parameters (required)
* @param requiredInt64Group Required Integer in group parameters (required)
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @throws ApiException if fails to make API call
*/
public ApiResponse<Void> testGroupParametersWithHttpInfo(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {
public ApiResponse<Void> testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {
Object localVarPostBody = new Object();
// verify the required parameter 'requiredStringGroup' is set
if (requiredStringGroup == null) {
throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
}
// verify the required parameter 'requiredBooleanGroup' is set
if (requiredBooleanGroup == null) {
throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");
}
// verify the required parameter 'requiredInt64Group' is set
if (requiredInt64Group == null) {
throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
}
// create path and map variables
String localVarPath = "/fake";
@@ -616,10 +637,14 @@ if (enumFormString != null)
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group));
if (booleanGroup != null)
if (requiredBooleanGroup != null)
localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup));
if (booleanGroup != null)
localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup));

View File

@@ -204,6 +204,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() throws ApiException {
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
*