diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index e21b7cf3bab..4128fb71b3d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -170,7 +170,6 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { config.additionalProperties().put(CodegenConstants.EXCLUDE_TESTS, true); } - if (System.getProperty("debugOpenAPI") != null) { Json.prettyPrint(openAPI); } else if (System.getProperty("debugSwagger") != null) { @@ -528,6 +527,21 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { operation.put("vendorExtensions", config.vendorExtensions()); } + // process top-level x-group-parameters + if (config.vendorExtensions().containsKey("x-group-parameters")) { + Boolean isGroupParameters = Boolean.valueOf(config.vendorExtensions().get("x-group-parameters").toString()); + + Map objectMap = (Map) operation.get("operations"); + @SuppressWarnings("unchecked") + List operations = (List) objectMap.get("operation"); + for (CodegenOperation op : operations) { + op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT); + if (!op.vendorExtensions.containsKey("x-group-parameters")) { + op.vendorExtensions.put("x-group-parameters", Boolean.TRUE); + } + } + } + // Pass sortParamsByRequiredFlag through to the Mustache template... boolean sortParamsByRequiredFlag = true; if (this.config.additionalProperties().containsKey(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG)) { @@ -1056,6 +1070,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { if (imports.size() > 0) { operations.put("hasImport", true); } + config.postProcessOperations(operations); config.postProcessOperationsWithModels(operations, allModels); if (objs.size() > 0) { diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 4307bdc0eb5..2a57404e601 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -800,6 +800,22 @@ paths: operationId: testGroupParameters x-group-parameters: true parameters: + - name: required_string_group + type: integer + in: query + description: Required String in group parameters + required: true + - name: required_boolean_group + type: boolean + in: header + description: Required Boolean in group parameters + required: true + - name: required_int64_group + type: integer + format: int64 + in: query + description: Required Integer in group parameters + required: true - name: string_group type: integer in: query diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index d60c17ddc3a..563ca99bc94 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -773,6 +773,25 @@ paths: operationId: testGroupParameters x-group-parameters: true parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 - name: string_group in: query description: String in group parameters diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index d9f2c5dc7f3..5be422501cd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -603,7 +603,7 @@ No authorization required # **TestGroupParameters** -> void TestGroupParameters (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) Fake endpoint to test group parameters (optional) @@ -624,6 +624,9 @@ namespace Example public void main() { var apiInstance = new FakeApi(); + var requiredStringGroup = 56; // int? | Required String in group parameters + var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters + var requiredInt64Group = 789; // long? | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) var int64Group = 789; // long? | Integer in group parameters (optional) @@ -631,7 +634,7 @@ namespace Example try { // Fake endpoint to test group parameters (optional) - apiInstance.TestGroupParameters(stringGroup, booleanGroup, int64Group); + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } catch (Exception e) { @@ -646,6 +649,9 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int?**| Required String in group parameters | + **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | + **requiredInt64Group** | **long?**| Required Integer in group parameters | **stringGroup** | **int?**| String in group parameters | [optional] **booleanGroup** | **bool?**| Boolean in group parameters | [optional] **int64Group** | **long?**| Integer in group parameters | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 283b7db9dc2..5de355ea7db 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -262,11 +262,14 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); /// /// Fake endpoint to test group parameters (optional) @@ -275,11 +278,14 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); /// /// test inline additionalProperties /// @@ -564,11 +570,14 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); /// /// Fake endpoint to test group parameters (optional) @@ -577,11 +586,14 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); /// /// test inline additionalProperties /// @@ -2162,25 +2174,40 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) { - 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) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) + throw new ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); @@ -2202,8 +2229,11 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + if (requiredStringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_string_group", requiredStringGroup)); // query parameter + if (requiredInt64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_int64_group", requiredInt64Group)); // query parameter if (stringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "string_group", stringGroup)); // query parameter if (int64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "int64_group", int64Group)); // query parameter + if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter @@ -2229,13 +2259,16 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) { - await TestGroupParametersAsyncWithHttpInfo(stringGroup, booleanGroup, int64Group); + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -2243,12 +2276,24 @@ namespace Org.OpenAPITools.Api /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters /// String in group parameters (optional) /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) + throw new ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); @@ -2270,8 +2315,11 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + if (requiredStringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_string_group", requiredStringGroup)); // query parameter + if (requiredInt64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_int64_group", requiredInt64Group)); // query parameter if (stringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "string_group", stringGroup)); // query parameter if (int64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "int64_group", int64Group)); // query parameter + if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 95a925396fa..40878d2c58d 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -593,6 +593,25 @@ paths: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer - description: String in group parameters in: query name: string_group diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index f3792213114..4b6efb216fc 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -914,6 +914,9 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona FakeApiService Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters * @param optional nil or *TestGroupParametersOpts - Optional Parameters: * @param "StringGroup" (optional.Int32) - String in group parameters * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters @@ -926,7 +929,7 @@ type TestGroupParametersOpts struct { Int64Group optional.Int64 } -func (a *FakeApiService) TestGroupParameters(ctx context.Context, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") localVarPostBody interface{} @@ -942,6 +945,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, localVarOption localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) + localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) if localVarOptionals != nil && localVarOptionals.StringGroup.IsSet() { localVarQueryParams.Add("string_group", parameterToString(localVarOptionals.StringGroup.Value(), "")) } @@ -965,6 +970,7 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, localVarOption if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } + localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") } diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index 8490ca254c7..c08f5d6f714 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -336,7 +336,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **TestGroupParameters** -> TestGroupParameters(ctx, optional) +> TestGroupParameters(ctx, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, optional) Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) @@ -346,6 +346,9 @@ Fake endpoint to test group parameters (optional) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **requiredStringGroup** | **int32**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **int64**| Required Integer in group parameters | **optional** | ***TestGroupParametersOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -353,6 +356,9 @@ Optional parameters are passed through a pointer to a TestGroupParametersOpts st Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + + + **stringGroup** | **optional.Int32**| String in group parameters | **booleanGroup** | **optional.Bool**| Boolean in group parameters | **int64Group** | **optional.Int64**| Integer in group parameters | diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs index 0af6e0fa70e..03b15031c2c 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs @@ -377,9 +377,15 @@ instance Produces TestEnumParameters MimeNoContent -- Fake endpoint to test group parameters (optional) -- testGroupParameters - :: OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent -testGroupParameters = + :: RequiredStringGroup -- ^ "requiredStringGroup" - Required String in group parameters + -> RequiredBooleanGroup -- ^ "requiredBooleanGroup" - Required Boolean in group parameters + -> RequiredInt64Group -- ^ "requiredInt64Group" - Required Integer in group parameters + -> OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent +testGroupParameters (RequiredStringGroup requiredStringGroup) (RequiredBooleanGroup requiredBooleanGroup) (RequiredInt64Group requiredInt64Group) = _mkRequest "DELETE" ["/fake"] + `setQuery` toQuery ("required_string_group", Just requiredStringGroup) + `setHeader` toHeader ("required_boolean_group", requiredBooleanGroup) + `setQuery` toQuery ("required_int64_group", Just requiredInt64Group) data TestGroupParameters diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index d6a12c9dc75..ef55290920b 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -180,9 +180,18 @@ newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) -- ** RequestBody newtype RequestBody = RequestBody { unRequestBody :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) +-- ** RequiredBooleanGroup +newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show) + -- ** RequiredFile newtype RequiredFile = RequiredFile { unRequiredFile :: FilePath } deriving (P.Eq, P.Show) +-- ** RequiredInt64Group +newtype RequiredInt64Group = RequiredInt64Group { unRequiredInt64Group :: Integer } deriving (P.Eq, P.Show) + +-- ** RequiredStringGroup +newtype RequiredStringGroup = RequiredStringGroup { unRequiredStringGroup :: Int } deriving (P.Eq, P.Show) + -- ** Status newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 95a925396fa..40878d2c58d 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -593,6 +593,25 @@ paths: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer - description: String in group parameters in: query name: string_group diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index af078f73628..e5bcaac7afe 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -249,16 +249,21 @@ public interface FakeApi extends ApiClient.Api { /** * 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) */ - @RequestLine("DELETE /fake?string_group={stringGroup}&int64_group={int64Group}") + @RequestLine("DELETE /fake?required_string_group={requiredStringGroup}&required_int64_group={requiredInt64Group}&string_group={stringGroup}&int64_group={int64Group}") @Headers({ "Accept: application/json", + "required_boolean_group: {requiredBooleanGroup}", + "boolean_group: {booleanGroup}" }) - void testGroupParameters(@Param("stringGroup") Integer stringGroup, @Param("booleanGroup") Boolean booleanGroup, @Param("int64Group") Long int64Group); + void testGroupParameters(@Param("requiredStringGroup") Integer requiredStringGroup, @Param("requiredBooleanGroup") Boolean requiredBooleanGroup, @Param("requiredInt64Group") Long requiredInt64Group, @Param("stringGroup") Integer stringGroup, @Param("booleanGroup") Boolean booleanGroup, @Param("int64Group") Long int64Group); /** * Fake endpoint to test group parameters (optional) @@ -268,26 +273,39 @@ public interface FakeApi extends ApiClient.Api { * is convenient for services with optional query parameters, especially when * used with the {@link TestGroupParametersQueryParams} class that allows for * building up this map in a fluent style. + * @param requiredBooleanGroup Required Boolean in group parameters (required) * @param booleanGroup Boolean in group parameters (optional) * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

*
    + *
  • requiredStringGroup - Required String in group parameters (required)
  • + *
  • requiredInt64Group - Required Integer in group parameters (required)
  • *
  • stringGroup - String in group parameters (optional)
  • *
  • int64Group - Integer in group parameters (optional)
  • *
*/ - @RequestLine("DELETE /fake?string_group={stringGroup}&int64_group={int64Group}") + @RequestLine("DELETE /fake?required_string_group={requiredStringGroup}&required_int64_group={requiredInt64Group}&string_group={stringGroup}&int64_group={int64Group}") @Headers({ "Accept: application/json", + "required_boolean_group: {requiredBooleanGroup}", + "boolean_group: {booleanGroup}" }) - void testGroupParameters(@Param("booleanGroup") Boolean booleanGroup, @QueryMap(encoded=true) Map queryParams); + void testGroupParameters(@Param("requiredBooleanGroup") Boolean requiredBooleanGroup, @Param("booleanGroup") Boolean booleanGroup, @QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the * testGroupParameters method in a fluent style. */ public static class TestGroupParametersQueryParams extends HashMap { + public TestGroupParametersQueryParams requiredStringGroup(final Integer value) { + put("required_string_group", EncodingUtils.encode(value)); + return this; + } + public TestGroupParametersQueryParams requiredInt64Group(final Long value) { + put("required_int64_group", EncodingUtils.encode(value)); + return this; + } public TestGroupParametersQueryParams stringGroup(final Integer value) { put("string_group", EncodingUtils.encode(value)); return this; diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java index 1203f5b63bd..bbb4a9bbc85 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; 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; @@ -85,6 +86,20 @@ public class FakeApiTest { } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + + /** * * @@ -202,6 +217,46 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ + @Test + public void testGroupParametersTestQueryMap() { + Boolean requiredBooleanGroup = null; + Boolean booleanGroup = null; + FakeApi.TestGroupParametersQueryParams queryParams = new FakeApi.TestGroupParametersQueryParams() + .requiredStringGroup(null) + .requiredInt64Group(null) + .stringGroup(null) + .int64Group(null); + // api.testGroupParameters(requiredBooleanGroup, booleanGroup, queryParams); + + // TODO: test validations + } + /** * test inline additionalProperties * diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index af078f73628..e5bcaac7afe 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -249,16 +249,21 @@ public interface FakeApi extends ApiClient.Api { /** * 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) */ - @RequestLine("DELETE /fake?string_group={stringGroup}&int64_group={int64Group}") + @RequestLine("DELETE /fake?required_string_group={requiredStringGroup}&required_int64_group={requiredInt64Group}&string_group={stringGroup}&int64_group={int64Group}") @Headers({ "Accept: application/json", + "required_boolean_group: {requiredBooleanGroup}", + "boolean_group: {booleanGroup}" }) - void testGroupParameters(@Param("stringGroup") Integer stringGroup, @Param("booleanGroup") Boolean booleanGroup, @Param("int64Group") Long int64Group); + void testGroupParameters(@Param("requiredStringGroup") Integer requiredStringGroup, @Param("requiredBooleanGroup") Boolean requiredBooleanGroup, @Param("requiredInt64Group") Long requiredInt64Group, @Param("stringGroup") Integer stringGroup, @Param("booleanGroup") Boolean booleanGroup, @Param("int64Group") Long int64Group); /** * Fake endpoint to test group parameters (optional) @@ -268,26 +273,39 @@ public interface FakeApi extends ApiClient.Api { * is convenient for services with optional query parameters, especially when * used with the {@link TestGroupParametersQueryParams} class that allows for * building up this map in a fluent style. + * @param requiredBooleanGroup Required Boolean in group parameters (required) * @param booleanGroup Boolean in group parameters (optional) * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

*
    + *
  • requiredStringGroup - Required String in group parameters (required)
  • + *
  • requiredInt64Group - Required Integer in group parameters (required)
  • *
  • stringGroup - String in group parameters (optional)
  • *
  • int64Group - Integer in group parameters (optional)
  • *
*/ - @RequestLine("DELETE /fake?string_group={stringGroup}&int64_group={int64Group}") + @RequestLine("DELETE /fake?required_string_group={requiredStringGroup}&required_int64_group={requiredInt64Group}&string_group={stringGroup}&int64_group={int64Group}") @Headers({ "Accept: application/json", + "required_boolean_group: {requiredBooleanGroup}", + "boolean_group: {booleanGroup}" }) - void testGroupParameters(@Param("booleanGroup") Boolean booleanGroup, @QueryMap(encoded=true) Map queryParams); + void testGroupParameters(@Param("requiredBooleanGroup") Boolean requiredBooleanGroup, @Param("booleanGroup") Boolean booleanGroup, @QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the * testGroupParameters method in a fluent style. */ public static class TestGroupParametersQueryParams extends HashMap { + public TestGroupParametersQueryParams requiredStringGroup(final Integer value) { + put("required_string_group", EncodingUtils.encode(value)); + return this; + } + public TestGroupParametersQueryParams requiredInt64Group(final Long value) { + put("required_int64_group", EncodingUtils.encode(value)); + return this; + } public TestGroupParametersQueryParams stringGroup(final Integer value) { put("string_group", EncodingUtils.encode(value)); return this; diff --git a/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java index c5153830112..bbb4a9bbc85 100644 --- a/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -217,6 +217,46 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ + @Test + public void testGroupParametersTestQueryMap() { + Boolean requiredBooleanGroup = null; + Boolean booleanGroup = null; + FakeApi.TestGroupParametersQueryParams queryParams = new FakeApi.TestGroupParametersQueryParams() + .requiredStringGroup(null) + .requiredInt64Group(null) + .stringGroup(null) + .int64Group(null); + // api.testGroupParameters(requiredBooleanGroup, booleanGroup, queryParams); + + // TODO: test validations + } + /** * test inline additionalProperties * diff --git a/samples/client/petstore/java/google-api-client/docs/FakeApi.md b/samples/client/petstore/java/google-api-client/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/google-api-client/docs/FakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java index 706f7ac9a5d..90a90a5f13c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java @@ -883,30 +883,65 @@ public class FakeApi { * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) *

400 - 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 IOException if an error occurs while attempting to invoke the API **/ - public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws IOException { - testGroupParametersForHttpResponse(stringGroup, booleanGroup, int64Group); + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws IOException { + testGroupParametersForHttpResponse(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) *

400 - Someting wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @throws IOException if an error occurs while attempting to invoke the API **/ - public void testGroupParameters(Map params) throws IOException { - testGroupParametersForHttpResponse(params); + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Map params) throws IOException { + testGroupParametersForHttpResponse(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, params); } - public HttpResponse testGroupParametersForHttpResponse(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws IOException { - + public HttpResponse testGroupParametersForHttpResponse(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws IOException { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + }// verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + }// verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); - if (stringGroup != null) { + if (requiredStringGroup != null) { + String key = "required_string_group"; + Object value = requiredStringGroup; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (requiredInt64Group != null) { + String key = "required_int64_group"; + Object value = requiredInt64Group; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (stringGroup != null) { String key = "string_group"; Object value = stringGroup; if (value instanceof Collection) { @@ -935,12 +970,25 @@ public class FakeApi { return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); } - public HttpResponse testGroupParametersForHttpResponse(Map params) throws IOException { - + public HttpResponse testGroupParametersForHttpResponse(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Map params) throws IOException { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + }// verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + }// verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new IllegalArgumentException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); // Copy the params argument if present, to allow passing in immutable maps Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'requiredStringGroup' to the map of query params + allParams.put("requiredStringGroup", requiredStringGroup); + // Add the required query param 'requiredInt64Group' to the map of query params + allParams.put("requiredInt64Group", requiredInt64Group); for (Map.Entry entry: allParams.entrySet()) { String key = entry.getKey(); diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java index 17250f43361..d8bfb243b10 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -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; @@ -102,6 +103,22 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws IOException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws IOException { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + /** * * @@ -187,6 +204,27 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws IOException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws IOException { + 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 * diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index 97fe4cc1356..f4f7e114907 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -489,14 +489,32 @@ 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 { Object localVarPostBody = null; + // 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"; @@ -506,10 +524,14 @@ if (enumFormString != null) Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPair("required_string_group", requiredStringGroup)); + localVarQueryParams.addAll(apiClient.parameterToPair("required_int64_group", requiredInt64Group)); localVarQueryParams.addAll(apiClient.parameterToPair("string_group", stringGroup)); localVarQueryParams.addAll(apiClient.parameterToPair("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)); diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java index 23f854df6ab..07f4a80a5b2 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -15,6 +15,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; 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; @@ -135,6 +136,22 @@ public class FakeApiTest { // TODO: test validations } + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client client = null; + Client response = api.testClientModel(client); + + // TODO: test validations + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -197,10 +214,13 @@ public class FakeApiTest { */ @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(stringGroup, booleanGroup, int64Group); + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index f27eb4d2d53..d167939bf5b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -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 testGroupParametersWithHttpInfo(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + public ApiResponse 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 localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + 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)); diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java index 11916028aac..07f4a80a5b2 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -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 * diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index 434cebdd6f3..068ba3e71f7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -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 testGroupParametersWithHttpInfo(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + public ApiResponse 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 localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + 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)); diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java index 66fd7294503..4731d235db3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -214,10 +214,13 @@ public class FakeApiTest { */ @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(stringGroup, booleanGroup, int64Group); + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java index f27eb4d2d53..d167939bf5b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -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 testGroupParametersWithHttpInfo(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + public ApiResponse 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 localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + 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)); diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java index 6fffb218baa..07f4a80a5b2 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -214,10 +214,13 @@ public class FakeApiTest { */ @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(stringGroup, booleanGroup, int64Group); + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 783dfb78ec2..49f8a954e98 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1307,6 +1307,9 @@ public class FakeApi { } /** * Build call for testGroupParameters + * @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) @@ -1315,7 +1318,7 @@ public class FakeApi { * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call testGroupParametersCall(Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = new Object(); // create path and map variables @@ -1323,6 +1326,14 @@ public class FakeApi { List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (requiredStringGroup != null) { + localVarQueryParams.addAll(apiClient.parameterToPair("required_string_group", requiredStringGroup)); + } + + if (requiredInt64Group != null) { + localVarQueryParams.addAll(apiClient.parameterToPair("required_int64_group", requiredInt64Group)); + } + if (stringGroup != null) { localVarQueryParams.addAll(apiClient.parameterToPair("string_group", stringGroup)); } @@ -1332,6 +1343,10 @@ public class FakeApi { } Map localVarHeaderParams = new HashMap(); + if (requiredBooleanGroup != null) { + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + } + if (booleanGroup != null) { localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); } @@ -1368,10 +1383,25 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testGroupParametersValidateBeforeCall(Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); + } + + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); + } + + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); + } - com.squareup.okhttp.Call call = testGroupParametersCall(stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); return call; } @@ -1379,32 +1409,41 @@ public class FakeApi { /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - testGroupParametersWithHttpInfo(stringGroup, booleanGroup, int64Group); + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + 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) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testGroupParametersWithHttpInfo(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(stringGroup, booleanGroup, int64Group, null, null); + public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null, null); return apiClient.execute(call); } /** * Fake endpoint to test group parameters (optional) (asynchronously) * 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) @@ -1412,7 +1451,7 @@ public class FakeApi { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testGroupParametersAsync(Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1433,7 +1472,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java index f23eef8b585..07f4a80a5b2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiException; 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; @@ -102,6 +103,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() throws ApiException { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + /** * * @@ -187,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 * diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 783dfb78ec2..49f8a954e98 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1307,6 +1307,9 @@ public class FakeApi { } /** * Build call for testGroupParameters + * @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) @@ -1315,7 +1318,7 @@ public class FakeApi { * @return Call to execute * @throws ApiException If fail to serialize the request body object */ - public com.squareup.okhttp.Call testGroupParametersCall(Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = new Object(); // create path and map variables @@ -1323,6 +1326,14 @@ public class FakeApi { List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); + if (requiredStringGroup != null) { + localVarQueryParams.addAll(apiClient.parameterToPair("required_string_group", requiredStringGroup)); + } + + if (requiredInt64Group != null) { + localVarQueryParams.addAll(apiClient.parameterToPair("required_int64_group", requiredInt64Group)); + } + if (stringGroup != null) { localVarQueryParams.addAll(apiClient.parameterToPair("string_group", stringGroup)); } @@ -1332,6 +1343,10 @@ public class FakeApi { } Map localVarHeaderParams = new HashMap(); + if (requiredBooleanGroup != null) { + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + } + if (booleanGroup != null) { localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); } @@ -1368,10 +1383,25 @@ public class FakeApi { } @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testGroupParametersValidateBeforeCall(Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); + } + + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); + } + + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); + } - com.squareup.okhttp.Call call = testGroupParametersCall(stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); return call; } @@ -1379,32 +1409,41 @@ public class FakeApi { /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body */ - public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - testGroupParametersWithHttpInfo(stringGroup, booleanGroup, int64Group); + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + 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) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ - public ApiResponse testGroupParametersWithHttpInfo(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(stringGroup, booleanGroup, int64Group, null, null); + public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null, null); return apiClient.execute(call); } /** * Fake endpoint to test group parameters (optional) (asynchronously) * 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) @@ -1412,7 +1451,7 @@ public class FakeApi { * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ - public com.squareup.okhttp.Call testGroupParametersAsync(Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1433,7 +1472,7 @@ public class FakeApi { }; } - com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java index 6fffb218baa..07f4a80a5b2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -214,10 +214,13 @@ public class FakeApiTest { */ @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(stringGroup, booleanGroup, int64Group); + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/docs/FakeApi.md b/samples/client/petstore/java/rest-assured/docs/FakeApi.md index 8d5f569c6c7..153e5030c27 100644 --- a/samples/client/petstore/java/rest-assured/docs/FakeApi.md +++ b/samples/client/petstore/java/rest-assured/docs/FakeApi.md @@ -416,7 +416,7 @@ No authorization required # **testGroupParameters** -> testGroupParameters(stringGroup, booleanGroup, int64Group) +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) Fake endpoint to test group parameters (optional) @@ -433,13 +433,19 @@ FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( () -> new RequestSpecBuilder() .setBaseUri("http://petstore.swagger.io:80/v2"))).fake(); -api.testGroupParameters().execute(r -> r.prettyPeek()); +api.testGroupParameters() + .requiredStringGroupQuery(requiredStringGroup) + .requiredBooleanGroupHeader(requiredBooleanGroup) + .requiredInt64GroupQuery(requiredInt64Group).execute(r -> r.prettyPeek()); ``` ### Parameters 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] diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java index 991442d3dd0..ac8e81a6c37 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1044,6 +1044,9 @@ public class FakeApi { * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) * + * @see #requiredStringGroupQuery Required String in group parameters (required) + * @see #requiredBooleanGroupHeader Required Boolean in group parameters (required) + * @see #requiredInt64GroupQuery Required Integer in group parameters (required) * @see #stringGroupQuery String in group parameters (optional) * @see #booleanGroupHeader Boolean in group parameters (optional) * @see #int64GroupQuery Integer in group parameters (optional) @@ -1072,6 +1075,17 @@ public class FakeApi { return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI)); } + public static final String REQUIRED_BOOLEAN_GROUP_HEADER = "required_boolean_group"; + + /** + * @param requiredBooleanGroup (Boolean) Required Boolean in group parameters (required) + * @return operation + */ + public TestGroupParametersOper requiredBooleanGroupHeader(String requiredBooleanGroup) { + reqSpec.addHeader(REQUIRED_BOOLEAN_GROUP_HEADER, requiredBooleanGroup); + return this; + } + public static final String BOOLEAN_GROUP_HEADER = "boolean_group"; /** @@ -1083,6 +1097,28 @@ public class FakeApi { return this; } + public static final String REQUIRED_STRING_GROUP_QUERY = "required_string_group"; + + /** + * @param requiredStringGroup (Integer) Required String in group parameters (required) + * @return operation + */ + public TestGroupParametersOper requiredStringGroupQuery(Object... requiredStringGroup) { + reqSpec.addQueryParam(REQUIRED_STRING_GROUP_QUERY, requiredStringGroup); + return this; + } + + public static final String REQUIRED_INT64_GROUP_QUERY = "required_int64_group"; + + /** + * @param requiredInt64Group (Long) Required Integer in group parameters (required) + * @return operation + */ + public TestGroupParametersOper requiredInt64GroupQuery(Object... requiredInt64Group) { + reqSpec.addQueryParam(REQUIRED_INT64_GROUP_QUERY, requiredInt64Group); + return this; + } + public static final String STRING_GROUP_QUERY = "string_group"; /** diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java index d05c8622726..f8746ac3c95 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -230,10 +230,16 @@ public class FakeApiTest { */ @Test public void shouldSee400AfterTestGroupParameters() { + Integer requiredStringGroup = null; + String requiredBooleanGroup = null; + Long requiredInt64Group = null; Integer stringGroup = null; String booleanGroup = null; Long int64Group = null; - api.testGroupParameters().execute(r -> r.prettyPeek()); + api.testGroupParameters() + .requiredStringGroupQuery(requiredStringGroup) + .requiredBooleanGroupHeader(requiredBooleanGroup) + .requiredInt64GroupQuery(requiredInt64Group).execute(r -> r.prettyPeek()); // TODO: test validations } diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index a1c5fef69c1..dff8c8271e8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -466,14 +466,32 @@ 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 { 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".replaceAll("\\{format\\}","json"); @@ -482,10 +500,14 @@ if (enumFormString != null) Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + 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)); diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java index f23eef8b585..07f4a80a5b2 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiException; 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; @@ -102,6 +103,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() throws ApiException { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + /** * * @@ -187,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 * diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 4a3cd69107c..725ad066104 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -425,23 +425,45 @@ public class FakeApi { * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) *

400 - 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 queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); + 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)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java index 373a0c691c7..5d14435fc03 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -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 * diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 4a3cd69107c..725ad066104 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -425,23 +425,45 @@ public class FakeApi { * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) *

400 - 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 queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); + 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)); diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java index 373a0c691c7..5d14435fc03 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -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 * diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index ed7fb62be50..a83105fd0d3 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -287,6 +287,9 @@ public interface FakeApi { * Fake endpoint to test group parameters (optional) * Sync method * 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) @@ -295,12 +298,15 @@ public interface FakeApi { @DELETE("/fake") Void testGroupParameters( - @retrofit.http.Query("string_group") Integer stringGroup, @retrofit.http.Header("boolean_group") Boolean booleanGroup, @retrofit.http.Query("int64_group") Long int64Group + @retrofit.http.Query("required_string_group") Integer requiredStringGroup, @retrofit.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit.http.Query("required_int64_group") Long requiredInt64Group, @retrofit.http.Query("string_group") Integer stringGroup, @retrofit.http.Header("boolean_group") Boolean booleanGroup, @retrofit.http.Query("int64_group") Long int64Group ); /** * Fake endpoint to test group parameters (optional) * Async method + * @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) @@ -309,7 +315,7 @@ public interface FakeApi { @DELETE("/fake") void testGroupParameters( - @retrofit.http.Query("string_group") Integer stringGroup, @retrofit.http.Header("boolean_group") Boolean booleanGroup, @retrofit.http.Query("int64_group") Long int64Group, Callback cb + @retrofit.http.Query("required_string_group") Integer requiredStringGroup, @retrofit.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit.http.Query("required_int64_group") Long requiredInt64Group, @retrofit.http.Query("string_group") Integer stringGroup, @retrofit.http.Header("boolean_group") Boolean booleanGroup, @retrofit.http.Query("int64_group") Long int64Group, Callback cb ); /** * test inline additionalProperties diff --git a/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/api/FakeApiTest.java index c5094b98fd5..d055e54ede9 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,6 +5,7 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import org.joda.time.DateTime; import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; import org.joda.time.LocalDate; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; @@ -81,6 +82,19 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + /** * * @@ -154,6 +168,24 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md index 3caa786e5ac..5335c1521aa 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index 84745f86ce9..88d49bfb020 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -163,6 +163,9 @@ public interface FakeApi { /** * 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) @@ -170,7 +173,7 @@ public interface FakeApi { */ @DELETE("fake") F.Promise> testGroupParameters( - @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group + @retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group ); /** diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/api/FakeApiTest.java index 649446d984c..82a96b9818b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; @@ -76,6 +77,18 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } /** * * @@ -145,6 +158,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md index 3caa786e5ac..5335c1521aa 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index 3394d297167..c542ee4d79c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -163,6 +163,9 @@ public interface FakeApi { /** * 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) @@ -170,7 +173,7 @@ public interface FakeApi { */ @DELETE("fake") CompletionStage> testGroupParameters( - @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group + @retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group ); /** diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/api/FakeApiTest.java index c7caf851a43..aec2e41c34e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; 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; @@ -76,6 +77,18 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } /** * * @@ -145,6 +158,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * diff --git a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md index 3caa786e5ac..5335c1521aa 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index 3394d297167..c542ee4d79c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -163,6 +163,9 @@ public interface FakeApi { /** * 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) @@ -170,7 +173,7 @@ public interface FakeApi { */ @DELETE("fake") CompletionStage> testGroupParameters( - @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group + @retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group ); /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java index 4889e92772c..aec2e41c34e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -1,17 +1,19 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; +import java.math.BigDecimal; import org.openapitools.client.model.Client; +import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.User; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.User; +import org.junit.Before; +import org.junit.Test; -import java.io.File; -import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -28,7 +30,7 @@ public class FakeApiTest { } /** - * + * * * Test serialization of outer boolean types */ @@ -40,7 +42,7 @@ public class FakeApiTest { // TODO: test validations } /** - * + * * * Test serialization of object with outer number type */ @@ -52,7 +54,7 @@ public class FakeApiTest { // TODO: test validations } /** - * + * * * Test serialization of outer number types */ @@ -64,7 +66,7 @@ public class FakeApiTest { // TODO: test validations } /** - * + * * * Test serialization of outer string types */ @@ -76,7 +78,7 @@ public class FakeApiTest { // TODO: test validations } /** - * + * * * For this test, the body for this request much reference a schema named `File`. */ @@ -88,9 +90,9 @@ public class FakeApiTest { // TODO: test validations } /** + * * - * - * + * */ @Test public void testBodyWithQueryParamsTest() { @@ -113,9 +115,9 @@ public class FakeApiTest { // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -156,10 +158,27 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * - * + * */ @Test public void testInlineAdditionalPropertiesTest() { @@ -171,7 +190,7 @@ public class FakeApiTest { /** * test json serialization of form data * - * + * */ @Test public void testJsonFormDataTest() { diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 3caa786e5ac..5335c1521aa 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index 1f6a1f76981..42da2aed960 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -158,6 +158,9 @@ public interface FakeApi { /** * 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) @@ -165,7 +168,7 @@ public interface FakeApi { */ @DELETE("fake") Call testGroupParameters( - @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group + @retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group ); /** diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java index c7caf851a43..aec2e41c34e 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; 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; @@ -76,6 +77,18 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } /** * * @@ -145,6 +158,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index 3caa786e5ac..5335c1521aa 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index 09f958ecd6a..1c1f58d8c15 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -158,6 +158,9 @@ public interface FakeApi { /** * 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) @@ -165,7 +168,7 @@ public interface FakeApi { */ @DELETE("fake") Observable testGroupParameters( - @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group + @retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group ); /** diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/api/FakeApiTest.java index c7caf851a43..aec2e41c34e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; 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; @@ -76,6 +77,18 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } /** * * @@ -145,6 +158,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 3caa786e5ac..5335c1521aa 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index dfdb1132524..01e20f57220 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -159,6 +159,9 @@ public interface FakeApi { /** * 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) @@ -166,7 +169,7 @@ public interface FakeApi { */ @DELETE("fake") Completable testGroupParameters( - @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group + @retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group ); /** diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java index c7caf851a43..aec2e41c34e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; 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; @@ -76,6 +77,18 @@ public class FakeApiTest { // TODO: test validations } + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } /** * * @@ -145,6 +158,23 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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 * diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 8ea6866dc51..34bb5172b87 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java index e95457a4270..d4349a5564e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -34,7 +34,7 @@ public interface FakeApi { void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> handler); - void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> handler); + void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> handler); void testInlineAdditionalProperties(Map requestBody, Handler> handler); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index fbc675cc003..39b3124f3a0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -393,25 +393,50 @@ if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormS /** * 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) * @param resultHandler Asynchronous result handler */ - public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> resultHandler) { + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> resultHandler) { Object localVarBody = null; + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters")); + return; + } + + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters")); + return; + } + + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters")); + return; + } + // create path and map variables String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList<>(); + 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)); // header params MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); - if (booleanGroup != null) + if (requiredBooleanGroup != null) + localVarHeaderParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); +if (booleanGroup != null) localVarHeaderParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); // form params diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java index 243a8fc4335..fce29914f89 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java @@ -262,26 +262,32 @@ public class FakeApi { /** * 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) * @param resultHandler Asynchronous result handler */ - public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> resultHandler) { - delegate.testGroupParameters(stringGroup, booleanGroup, int64Group, resultHandler); + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> resultHandler) { + delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, resultHandler); } /** * 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) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) { + public Single rxTestGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testGroupParameters(stringGroup, booleanGroup, int64Group, fut); + delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, fut); })); } /** diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java index 4edda7faf91..611a4cf6149 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -15,6 +15,7 @@ package org.openapitools.client.api; import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import org.openapitools.client.model.Client; +import org.openapitools.client.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.OuterComposite; @@ -127,6 +128,22 @@ public class FakeApiTest { }); } + /** + * + * For this test, the body for this request much reference a schema named `File`. + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testBodyWithFileSchemaTest(TestContext context) { + Async async = context.async(); + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass, result -> { + // TODO: test validations + async.complete(); + }); + } + /** * * @@ -212,6 +229,27 @@ public class FakeApiTest { }); } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testGroupParametersTest(TestContext context) { + Async async = context.async(); + 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, result -> { + // TODO: test validations + async.complete(); + }); + } + /** * test inline additionalProperties * diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index a29ac9987a3..62046473c1f 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **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] diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 091f59ea27c..a1356800406 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -424,23 +424,45 @@ public class FakeApi { * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) *

400 - 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 Mono testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException { + public Mono 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 queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); + 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)); diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java index 9c1ca7fdc04..aeb8379aee7 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -176,6 +176,24 @@ public class FakeApiTest { // TODO: test validations } + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @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).block(); + + // TODO: test validations + } + /** * test inline additionalProperties * diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index c7c1a117fd8..c1ea9868ecc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -502,7 +502,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **testGroupParameters** -> testGroupParameters($string_group, $boolean_group, $int64_group) +> testGroupParameters($required_string_group, $required_boolean_group, $required_int64_group, $string_group, $boolean_group, $int64_group) Fake endpoint to test group parameters (optional) @@ -518,6 +518,9 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); +$associate_array['required_string_group'] = 56; // int | Required String in group parameters +$associate_array['required_boolean_group'] = True; // bool | Required Boolean in group parameters +$associate_array['required_int64_group'] = 56; // int | Required Integer in group parameters $associate_array['string_group'] = 56; // int | String in group parameters $associate_array['boolean_group'] = True; // bool | Boolean in group parameters $associate_array['int64_group'] = 56; // int | Integer in group parameters @@ -536,6 +539,9 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | **string_group** | **int**| String in group parameters | [optional] **boolean_group** | **bool**| Boolean in group parameters | [optional] **int64_group** | **int**| Integer in group parameters | [optional] diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 11d71a69378..f3f1404bd2d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -2524,6 +2524,9 @@ class FakeApi * * Note: the input parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2544,6 +2547,9 @@ class FakeApi * * Note: the inpput parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2554,7 +2560,7 @@ class FakeApi */ public function testGroupParametersWithHttpInfo($associative_array) { - $request = $this->testGroupParametersRequest($associative_array['string_group'], $associative_array['boolean_group'], $associative_array['int64_group']); + $request = $this->testGroupParametersRequest($associative_array['required_string_group'], $associative_array['required_boolean_group'], $associative_array['required_int64_group'], $associative_array['string_group'], $associative_array['boolean_group'], $associative_array['int64_group']); try { $options = $this->createHttpClientOption(); @@ -2600,6 +2606,9 @@ class FakeApi * * Note: the inpput parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2624,6 +2633,9 @@ class FakeApi * * Note: the inpput parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2664,6 +2676,9 @@ class FakeApi * * Note: the input parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2674,10 +2689,31 @@ class FakeApi protected function testGroupParametersRequest($associative_array) { // unbox the parameters from the associative array + $required_string_group = array_key_exists('required_string_group', $associative_array) ? $associative_array['required_string_group'] : null; + $required_boolean_group = array_key_exists('required_boolean_group', $associative_array) ? $associative_array['required_boolean_group'] : null; + $required_int64_group = array_key_exists('required_int64_group', $associative_array) ? $associative_array['required_int64_group'] : null; $string_group = array_key_exists('string_group', $associative_array) ? $associative_array['string_group'] : null; $boolean_group = array_key_exists('boolean_group', $associative_array) ? $associative_array['boolean_group'] : null; $int64_group = array_key_exists('int64_group', $associative_array) ? $associative_array['int64_group'] : null; + // verify the required parameter 'required_string_group' is set + if ($required_string_group === null || (is_array($required_string_group) && count($required_string_group) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $required_string_group when calling testGroupParameters' + ); + } + // verify the required parameter 'required_boolean_group' is set + if ($required_boolean_group === null || (is_array($required_boolean_group) && count($required_boolean_group) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $required_boolean_group when calling testGroupParameters' + ); + } + // verify the required parameter 'required_int64_group' is set + if ($required_int64_group === null || (is_array($required_int64_group) && count($required_int64_group) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $required_int64_group when calling testGroupParameters' + ); + } $resourcePath = '/fake'; $formParams = []; @@ -2686,6 +2722,14 @@ class FakeApi $httpBody = ''; $multipart = false; + // query params + if ($required_string_group !== null) { + $queryParams['required_string_group'] = ObjectSerializer::toQueryValue($required_string_group); + } + // query params + if ($required_int64_group !== null) { + $queryParams['required_int64_group'] = ObjectSerializer::toQueryValue($required_int64_group); + } // query params if ($string_group !== null) { $queryParams['string_group'] = ObjectSerializer::toQueryValue($string_group); @@ -2695,6 +2739,10 @@ class FakeApi $queryParams['int64_group'] = ObjectSerializer::toQueryValue($int64_group); } // header params + if ($required_boolean_group !== null) { + $headerParams['required_boolean_group'] = ObjectSerializer::toHeaderValue($required_boolean_group); + } + // header params if ($boolean_group !== null) { $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue($boolean_group); } diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 59edb6114f8..3a26c4926c1 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -472,7 +472,7 @@ No authorization required # **test_group_parameters** -> test_group_parameters(opts) +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) Fake endpoint to test group parameters (optional) @@ -484,6 +484,9 @@ Fake endpoint to test group parameters (optional) require 'petstore' api_instance = Petstore::FakeApi.new +required_string_group = 56 # Integer | Required String in group parameters +required_boolean_group = true # BOOLEAN | Required Boolean in group parameters +required_int64_group = 56 # Integer | Required Integer in group parameters opts = { string_group: 56, # Integer | String in group parameters boolean_group: true, # BOOLEAN | Boolean in group parameters @@ -492,7 +495,7 @@ opts = { begin #Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(opts) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_group_parameters: #{e}" end @@ -502,6 +505,9 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **required_string_group** | **Integer**| Required String in group parameters | + **required_boolean_group** | **BOOLEAN**| Required Boolean in group parameters | + **required_int64_group** | **Integer**| Required Integer in group parameters | **string_group** | **Integer**| String in group parameters | [optional] **boolean_group** | **BOOLEAN**| Boolean in group parameters | [optional] **int64_group** | **Integer**| Integer in group parameters | [optional] diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 05843a31952..dd13c6540fe 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -627,37 +627,58 @@ module Petstore # Fake endpoint to test group parameters (optional) # Fake endpoint to test group parameters (optional) + # @param required_string_group Required String in group parameters + # @param required_boolean_group Required Boolean in group parameters + # @param required_int64_group Required Integer in group parameters # @param [Hash] opts the optional parameters # @option opts [Integer] :string_group String in group parameters # @option opts [BOOLEAN] :boolean_group Boolean in group parameters # @option opts [Integer] :int64_group Integer in group parameters # @return [nil] - def test_group_parameters(opts = {}) - test_group_parameters_with_http_info(opts) + def test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts = {}) + test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts) nil end # Fake endpoint to test group parameters (optional) # Fake endpoint to test group parameters (optional) + # @param required_string_group Required String in group parameters + # @param required_boolean_group Required Boolean in group parameters + # @param required_int64_group Required Integer in group parameters # @param [Hash] opts the optional parameters # @option opts [Integer] :string_group String in group parameters # @option opts [BOOLEAN] :boolean_group Boolean in group parameters # @option opts [Integer] :int64_group Integer in group parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def test_group_parameters_with_http_info(opts = {}) + def test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...' end + # verify the required parameter 'required_string_group' is set + if @api_client.config.client_side_validation && required_string_group.nil? + fail ArgumentError, "Missing the required parameter 'required_string_group' when calling FakeApi.test_group_parameters" + end + # verify the required parameter 'required_boolean_group' is set + if @api_client.config.client_side_validation && required_boolean_group.nil? + fail ArgumentError, "Missing the required parameter 'required_boolean_group' when calling FakeApi.test_group_parameters" + end + # verify the required parameter 'required_int64_group' is set + if @api_client.config.client_side_validation && required_int64_group.nil? + fail ArgumentError, "Missing the required parameter 'required_int64_group' when calling FakeApi.test_group_parameters" + end # resource path local_var_path = '/fake' # query parameters query_params = {} + query_params[:'required_string_group'] = required_string_group + query_params[:'required_int64_group'] = required_int64_group query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil? query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil? # header parameters header_params = {} + header_params[:'required_boolean_group'] = required_boolean_group header_params[:'boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil? # form parameters diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index e3d7f5e2051..d428bf33f0b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -502,7 +502,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **testGroupParameters** -> testGroupParameters($string_group, $boolean_group, $int64_group) +> testGroupParameters($required_string_group, $required_boolean_group, $required_int64_group, $string_group, $boolean_group, $int64_group) Fake endpoint to test group parameters (optional) @@ -518,6 +518,9 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); +$associate_array['required_string_group'] = 56; // int | Required String in group parameters +$associate_array['required_boolean_group'] = True; // bool | Required Boolean in group parameters +$associate_array['required_int64_group'] = 56; // int | Required Integer in group parameters $associate_array['string_group'] = 56; // int | String in group parameters $associate_array['boolean_group'] = True; // bool | Boolean in group parameters $associate_array['int64_group'] = 56; // int | Integer in group parameters @@ -536,6 +539,9 @@ Note: the input parameter is an associative array with the keys listed as the pa Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | **string_group** | **int**| String in group parameters | [optional] **boolean_group** | **bool**| Boolean in group parameters | [optional] **int64_group** | **int**| Integer in group parameters | [optional] diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index fe2920a3c0c..3b2a198a771 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -2524,6 +2524,9 @@ class FakeApi * * Note: the input parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2544,6 +2547,9 @@ class FakeApi * * Note: the inpput parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2554,7 +2560,7 @@ class FakeApi */ public function testGroupParametersWithHttpInfo($associative_array) { - $request = $this->testGroupParametersRequest($associative_array['string_group'], $associative_array['boolean_group'], $associative_array['int64_group']); + $request = $this->testGroupParametersRequest($associative_array['required_string_group'], $associative_array['required_boolean_group'], $associative_array['required_int64_group'], $associative_array['string_group'], $associative_array['boolean_group'], $associative_array['int64_group']); try { $options = $this->createHttpClientOption(); @@ -2600,6 +2606,9 @@ class FakeApi * * Note: the inpput parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2624,6 +2633,9 @@ class FakeApi * * Note: the inpput parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2664,6 +2676,9 @@ class FakeApi * * Note: the input parameter is an associative array with the keys listed as the parameter name below * + * @param int $required_string_group Required String in group parameters (required) + * @param bool $required_boolean_group Required Boolean in group parameters (required) + * @param int $required_int64_group Required Integer in group parameters (required) * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) @@ -2674,10 +2689,31 @@ class FakeApi protected function testGroupParametersRequest($associative_array) { // unbox the parameters from the associative array + $required_string_group = array_key_exists('required_string_group', $associative_array) ? $associative_array['required_string_group'] : null; + $required_boolean_group = array_key_exists('required_boolean_group', $associative_array) ? $associative_array['required_boolean_group'] : null; + $required_int64_group = array_key_exists('required_int64_group', $associative_array) ? $associative_array['required_int64_group'] : null; $string_group = array_key_exists('string_group', $associative_array) ? $associative_array['string_group'] : null; $boolean_group = array_key_exists('boolean_group', $associative_array) ? $associative_array['boolean_group'] : null; $int64_group = array_key_exists('int64_group', $associative_array) ? $associative_array['int64_group'] : null; + // verify the required parameter 'required_string_group' is set + if ($required_string_group === null || (is_array($required_string_group) && count($required_string_group) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $required_string_group when calling testGroupParameters' + ); + } + // verify the required parameter 'required_boolean_group' is set + if ($required_boolean_group === null || (is_array($required_boolean_group) && count($required_boolean_group) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $required_boolean_group when calling testGroupParameters' + ); + } + // verify the required parameter 'required_int64_group' is set + if ($required_int64_group === null || (is_array($required_int64_group) && count($required_int64_group) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $required_int64_group when calling testGroupParameters' + ); + } $resourcePath = '/fake'; $formParams = []; @@ -2686,6 +2722,14 @@ class FakeApi $httpBody = ''; $multipart = false; + // query params + if ($required_string_group !== null) { + $queryParams['required_string_group'] = ObjectSerializer::toQueryValue($required_string_group); + } + // query params + if ($required_int64_group !== null) { + $queryParams['required_int64_group'] = ObjectSerializer::toQueryValue($required_int64_group); + } // query params if ($string_group !== null) { $queryParams['string_group'] = ObjectSerializer::toQueryValue($string_group); @@ -2695,6 +2739,10 @@ class FakeApi $queryParams['int64_group'] = ObjectSerializer::toQueryValue($int64_group); } // header params + if ($required_boolean_group !== null) { + $headerParams['required_boolean_group'] = ObjectSerializer::toHeaderValue($required_boolean_group); + } + // header params if ($boolean_group !== null) { $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue($boolean_group); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java index b212f1c67d1..0bd54724ded 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java @@ -141,7 +141,7 @@ public interface FakeApi { @ApiOperation(value = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) - public void testGroupParameters(@QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group); + public void testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup, @HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, @QueryParam("required_int64_group") @NotNull Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group); /** * test inline additionalProperties diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 812581c5b14..061e7112d55 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -109,7 +109,7 @@ public class FakeApiServiceImpl implements FakeApi { * Fake endpoint to test group parameters (optional) * */ - public void testGroupParameters(Integer stringGroup, Boolean booleanGroup, Long int64Group) { + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java index b476e5528d0..5816222f1e7 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java @@ -248,10 +248,13 @@ public class FakeApiTest { */ @Test public void testGroupParametersTest() { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; Integer stringGroup = null; Boolean booleanGroup = null; Long int64Group = null; - //api.testGroupParameters(stringGroup, booleanGroup, int64Group); + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index a8db12b2afc..a872ff17f4e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -208,12 +208,15 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - public Response testGroupParameters(@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup + public Response testGroupParameters(@ApiParam(value = "Required String in group parameters",required=true) @QueryParam("required_string_group") Integer requiredStringGroup +,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup +,@ApiParam(value = "Required Integer in group parameters",required=true) @QueryParam("required_int64_group") Long requiredInt64Group +,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup ,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup ,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testGroupParameters(stringGroup,booleanGroup,int64Group,securityContext); + return delegate.testGroupParameters(requiredStringGroup,requiredBooleanGroup,requiredInt64Group,stringGroup,booleanGroup,int64Group,securityContext); } @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java index fbf3fc75bc5..fc90d3b8e1a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java @@ -35,7 +35,7 @@ public abstract class FakeApiService { public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,InputStream binaryInputStream, FormDataContentDisposition binaryDetail,LocalDate date,OffsetDateTime dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException; public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; - public abstract Response testGroupParameters( Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; + public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup,Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 52d6b276ae4..b608ee79159 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -72,7 +72,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testGroupParameters( Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { + public Response testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 304ddc3d28c..c47f03f0462 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -207,12 +207,15 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - public Response testGroupParameters(@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup + public Response testGroupParameters(@ApiParam(value = "Required String in group parameters",required=true) @QueryParam("required_string_group") Integer requiredStringGroup +,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup +,@ApiParam(value = "Required Integer in group parameters",required=true) @QueryParam("required_int64_group") Long requiredInt64Group +,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup ,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup ,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testGroupParameters(stringGroup,booleanGroup,int64Group,securityContext); + return delegate.testGroupParameters(requiredStringGroup,requiredBooleanGroup,requiredInt64Group,stringGroup,booleanGroup,int64Group,securityContext); } @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index 8ea44f5923d..9319d058951 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -34,7 +34,7 @@ public abstract class FakeApiService { public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,InputStream binaryInputStream, FormDataContentDisposition binaryDetail,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException; public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; - public abstract Response testGroupParameters( Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; + public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup,Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 37288374e7f..d771656bb35 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -71,7 +71,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testGroupParameters( Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { + public Response testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java index b8cd7c76872..0827c2758d1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java @@ -104,7 +104,7 @@ public interface FakeApi { @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - void testGroupParameters(@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); + void testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 799de419314..7aaa0e0a18b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -635,6 +635,25 @@ paths: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer - description: String in group parameters in: query name: string_group diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index 80e6cee3985..a5ed5461ef8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -132,7 +132,7 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - public Response testGroupParameters(@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group) { + public Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 799de419314..7aaa0e0a18b 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -635,6 +635,25 @@ paths: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer - description: String in group parameters in: query name: string_group diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 916ba073b33..a7d6b517654 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -191,12 +191,15 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) public Response testGroupParameters( + @ApiParam(value = "Required String in group parameters",required=true) @QueryParam("required_string_group") Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, + @ApiParam(value = "Required Integer in group parameters",required=true) @QueryParam("required_int64_group") Long requiredInt64Group, @ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup, @ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup, @ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testGroupParameters(stringGroup,booleanGroup,int64Group,securityContext); + return delegate.testGroupParameters(requiredStringGroup,requiredBooleanGroup,requiredInt64Group,stringGroup,booleanGroup,int64Group,securityContext); } @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index 55f5a5257d0..fed55467984 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -45,7 +45,7 @@ public abstract class FakeApiService { throws NotFoundException; public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; - public abstract Response testGroupParameters( Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) + public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup,Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index ae4238f4d82..6c0a98ec53a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -82,7 +82,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testGroupParameters( Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) + public Response testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java index 80d3018bcad..192e2fdc1c8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java @@ -192,12 +192,15 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) public Response testGroupParameters( + @ApiParam(value = "Required String in group parameters",required=true) @QueryParam("required_string_group") Integer requiredStringGroup, + @ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, + @ApiParam(value = "Required Integer in group parameters",required=true) @QueryParam("required_int64_group") Long requiredInt64Group, @ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup, @ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup, @ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testGroupParameters(stringGroup,booleanGroup,int64Group,securityContext); + return delegate.testGroupParameters(requiredStringGroup,requiredBooleanGroup,requiredInt64Group,stringGroup,booleanGroup,int64Group,securityContext); } @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java index 20f05383f60..143287741bd 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java @@ -46,7 +46,7 @@ public abstract class FakeApiService { throws NotFoundException; public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; - public abstract Response testGroupParameters( Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) + public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup,Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 6861c8607aa..e2c2e189cac 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -83,7 +83,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testGroupParameters( Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) + public Response testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 57b8c57a76b..0dc93668755 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -206,12 +206,15 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - public Response testGroupParameters(@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup + public Response testGroupParameters(@ApiParam(value = "Required String in group parameters",required=true) @QueryParam("required_string_group") Integer requiredStringGroup +,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup +,@ApiParam(value = "Required Integer in group parameters",required=true) @QueryParam("required_int64_group") Long requiredInt64Group +,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup ,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup ,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testGroupParameters(stringGroup,booleanGroup,int64Group,securityContext); + return delegate.testGroupParameters(requiredStringGroup,requiredBooleanGroup,requiredInt64Group,stringGroup,booleanGroup,int64Group,securityContext); } @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index d7e2031b5b5..febdb0d1a6d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -33,7 +33,7 @@ public abstract class FakeApiService { public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,InputStream binaryInputStream, FormDataContentDisposition binaryDetail,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException; public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; - public abstract Response testGroupParameters( Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; + public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup,Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index fa4bb591ee6..862ccc6b7d0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -70,7 +70,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testGroupParameters( Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { + public Response testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 16131c7596c..986a66be5a2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -207,12 +207,15 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - public Response testGroupParameters(@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup + public Response testGroupParameters(@ApiParam(value = "Required String in group parameters",required=true) @QueryParam("required_string_group") Integer requiredStringGroup +,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup +,@ApiParam(value = "Required Integer in group parameters",required=true) @QueryParam("required_int64_group") Long requiredInt64Group +,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup ,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup ,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testGroupParameters(stringGroup,booleanGroup,int64Group,securityContext); + return delegate.testGroupParameters(requiredStringGroup,requiredBooleanGroup,requiredInt64Group,stringGroup,booleanGroup,int64Group,securityContext); } @POST @Path("/inline-additionalProperties") diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java index 8ea44f5923d..9319d058951 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java @@ -34,7 +34,7 @@ public abstract class FakeApiService { public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,InputStream binaryInputStream, FormDataContentDisposition binaryDetail,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException; public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; - public abstract Response testGroupParameters( Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; + public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup,Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup,Boolean booleanGroup, Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 37288374e7f..d771656bb35 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -71,7 +71,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testGroupParameters( Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { + public Response testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index decfebfb5f7..fd3261ab546 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -199,6 +199,21 @@ class FakeApi extends Controller //not path params validation + if (!isset($input['required_string_group'])) { + throw new \InvalidArgumentException('Missing the required parameter $required_string_group when calling testGroupParameters'); + } + $required_string_group = $input['required_string_group']; + + if (!isset($input['required_boolean_group'])) { + throw new \InvalidArgumentException('Missing the required parameter $required_boolean_group when calling testGroupParameters'); + } + $required_boolean_group = $input['required_boolean_group']; + + if (!isset($input['required_int64_group'])) { + throw new \InvalidArgumentException('Missing the required parameter $required_int64_group when calling testGroupParameters'); + } + $required_int64_group = $input['required_int64_group']; + $string_group = $input['string_group']; $boolean_group = $input['boolean_group']; diff --git a/samples/server/petstore/php-slim/lib/Api/FakeApi.php b/samples/server/petstore/php-slim/lib/Api/FakeApi.php index 5934463100a..d6dd7958c8f 100644 --- a/samples/server/petstore/php-slim/lib/Api/FakeApi.php +++ b/samples/server/petstore/php-slim/lib/Api/FakeApi.php @@ -218,8 +218,11 @@ class FakeApi extends AbstractApiController public function testGroupParameters($request, $response, $args) { $headers = $request->getHeaders(); + $requiredBooleanGroup = $request->hasHeader('required_boolean_group') ? $headers['required_boolean_group'] : null; $booleanGroup = $request->hasHeader('boolean_group') ? $headers['boolean_group'] : null; $queryParams = $request->getQueryParams(); + $requiredStringGroup = $request->getQueryParam('required_string_group'); + $requiredInt64Group = $request->getQueryParam('required_int64_group'); $stringGroup = $request->getQueryParam('string_group'); $int64Group = $request->getQueryParam('int64_group'); $response->write('How about implementing testGroupParameters as a DELETE method ?'); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 740684c9c49..3d2219c1a40 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -183,7 +183,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default CompletableFuture> testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default CompletableFuture> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 34474fb2f7e..73d426743f9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -178,7 +178,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 80d658308bb..c24a3440068 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -127,7 +127,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index 98b54389e3a..a4991d3e5f1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -97,7 +97,7 @@ public class FakeApiController implements FakeApi { } - public ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 80d658308bb..c24a3440068 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -127,7 +127,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 7981d705578..c3369289623 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -97,7 +97,7 @@ public class FakeApiController implements FakeApi { } - public ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 1cfd6cdbdf5..0dbb0526a53 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -149,8 +149,8 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { - return getDelegate().testGroupParameters(stringGroup, booleanGroup, int64Group); + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2694060b724..9c0f4d8375d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -144,7 +144,10 @@ public interface FakeApiDelegate { /** * @see FakeApi#testGroupParameters */ - default ResponseEntity testGroupParameters(Integer stringGroup, + default ResponseEntity testGroupParameters(Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, Boolean booleanGroup, Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 80d658308bb..c24a3440068 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -127,7 +127,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 41ebeb12176..9d4ef3e8206 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -74,8 +74,8 @@ public class FakeApiController implements FakeApi { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - public ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { - return delegate.testGroupParameters(stringGroup, booleanGroup, int64Group); + public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map requestBody) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index cd84bcec314..64d24f36c56 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -93,7 +93,10 @@ public interface FakeApiDelegate { /** * @see FakeApi#testGroupParameters */ - ResponseEntity testGroupParameters(Integer stringGroup, + ResponseEntity testGroupParameters(Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, Boolean booleanGroup, Long int64Group); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index a33bc5dbb0d..509cf98165a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -197,11 +197,12 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong") }) @ApiImplicitParams({ + @ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required=true, dataType = "Boolean", paramType = "header"), @ApiImplicitParam(name = "booleanGroup", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 2111513f467..a027b932a3c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -152,8 +152,8 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default Mono> testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, ServerWebExchange exchange) { - return getDelegate().testGroupParameters(stringGroup, booleanGroup, int64Group, exchange); + default Mono> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, ServerWebExchange exchange) { + return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 117a233a8e0..3b3f23ccece 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -170,7 +170,10 @@ public interface FakeApiDelegate { /** * @see FakeApi#testGroupParameters */ - default Mono> testGroupParameters(Integer stringGroup, + default Mono> testGroupParameters(Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, Boolean booleanGroup, Long int64Group, ServerWebExchange exchange) { diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index ad445e88402..f3f7ba18010 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -666,6 +666,25 @@ paths: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer - description: String in group parameters in: query name: string_group diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 4805c6d10a6..5885a85911f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -178,7 +178,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Optional booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Optional booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index e54182d3ae6..d6095b486e5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -191,7 +191,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index a3a21d4172b..5ec7e4c7052 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -178,7 +178,7 @@ public interface FakeApi { @ApiResponse(code = 400, message = "Someting wrong") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); }