diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index e0e409926dd..1517a3eb447 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -7234,7 +7234,7 @@ public class DefaultCodegen implements CodegenConfig { } protected void updateRequestBodyForMap(CodegenParameter codegenParameter, Schema schema, String name, Set imports, String bodyParameterName) { - if (ModelUtils.isGenerateAliasAsModel(schema) && StringUtils.isNotBlank(name)) { + if (StringUtils.isNotBlank(name)) { this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true); } else { Schema inner = ModelUtils.getAdditionalProperties(schema); diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 8f2b63eefe9..6d3946023a8 100644 --- a/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -980,6 +980,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index baf47ed4778..2fab0cbf594 100644 --- a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -977,6 +977,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 46818c821cf..4c4b450e806 100644 --- a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -965,6 +965,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 4c260896757..035f90534ba 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -963,6 +963,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml index af48b1a1136..77bbc979e03 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml @@ -939,6 +939,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 7c0f833e2f9..d85f7164628 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -943,6 +943,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml index 602ba230ba5..20c7e2f2684 100644 --- a/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml @@ -978,6 +978,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 68c92decbc3..707d452b494 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -959,6 +959,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: 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 746d1be1134..e9f73948e9b 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 @@ -1014,6 +1014,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/nullable: post: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml index 746d1be1134..e9f73948e9b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1014,6 +1014,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/nullable: post: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml index d9d5acca432..c620afc8c98 100644 --- a/modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1014,6 +1014,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 6a77f1bd7e2..aecc1b8d447 100644 --- a/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -944,6 +944,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index d6b0336a753..3bd93b2b5fc 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1066,6 +1066,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml index 0cc7a673035..c023acfdc39 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1002,6 +1002,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/date-time-query-params: put: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml index 36ff5700aac..c87242a6329 100644 --- a/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1050,6 +1050,27 @@ paths: type: string description: request body required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true /fake/body-with-query-params: put: tags: diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES index e52637ec329..ddeca89d213 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -209,6 +210,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md index 50e6c8e215c..af827f28641 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md @@ -122,6 +122,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -232,6 +233,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md index 9c646838c3d..c8a21d2e25c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs index aef969f7935..7282ba7821b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs @@ -365,6 +365,26 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody, int operationIndex = 0); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -810,6 +830,31 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -3093,6 +3138,148 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..f15b6dbfb61 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this._SomeProperty = someProperty; + if (this.SomeProperty != null) + { + this._flagSomeProperty = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty + { + get{ return _SomeProperty;} + set + { + _SomeProperty = value; + _flagSomeProperty = true; + } + } + private string _SomeProperty; + private bool _flagSomeProperty; + + /// + /// Returns false as SomeProperty should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSomeProperty() + { + return _flagSomeProperty; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/.openapi-generator/FILES index 4e462324c9c..03f61d17360 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/.openapi-generator/FILES @@ -91,6 +91,7 @@ docs/models/SpecialModelName.md docs/models/Tag.md docs/models/TestCollectionEndingWithWordList.md docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -217,6 +218,7 @@ src/UseSourceGeneration/Model/SpecialModelName.cs src/UseSourceGeneration/Model/Tag.cs src/UseSourceGeneration/Model/TestCollectionEndingWithWordList.cs src/UseSourceGeneration/Model/TestCollectionEndingWithWordListObject.cs +src/UseSourceGeneration/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/UseSourceGeneration/Model/Triangle.cs src/UseSourceGeneration/Model/TriangleInterface.cs src/UseSourceGeneration/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/apis/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/apis/FakeApi.md index 848b3c5a375..54e9f37c6de 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/apis/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using UseSourceGeneration.Api; +using UseSourceGeneration.Client; +using UseSourceGeneration.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..2f01b5a9898 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# UseSourceGeneration.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..5e499f68268 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using UseSourceGeneration.Model; +using UseSourceGeneration.Client; +using System.Reflection; + +namespace UseSourceGeneration.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Api/FakeApi.cs index d1d53093f5b..0a7cfe99bb2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Api/FakeApi.cs @@ -384,6 +384,29 @@ namespace UseSourceGeneration.Api /// Task<ApiResponse>object>?> Task?> TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>object>?> + Task?> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + /// /// test json serialization of form data /// @@ -715,6 +738,26 @@ namespace UseSourceGeneration.Api OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler>? OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(ApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2946,6 +2989,148 @@ namespace UseSourceGeneration.Api } } + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = HttpMethod.Post; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ApiResponse apiResponseLocalVar = new ApiResponse(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + partial void FormatTestJsonFormData(ref string param, ref string param2); /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Client/HostConfiguration.cs index e173927d9f7..7a8056ab4da 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Client/HostConfiguration.cs @@ -128,6 +128,7 @@ namespace UseSourceGeneration.Client _jsonOptions.Converters.Add(new TagJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); @@ -221,6 +222,7 @@ namespace UseSourceGeneration.Client new TagSerializationContext(), new TestCollectionEndingWithWordListSerializationContext(), new TestCollectionEndingWithWordListObjectSerializationContext(), + new TestInlineFreeformAdditionalPropertiesRequestSerializationContext(), new TriangleSerializationContext(), new TriangleInterfaceSerializationContext(), new UserSerializationContext(), diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..dd3c3ec026a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration/src/UseSourceGeneration/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,184 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = UseSourceGeneration.Client.ClientUtils; +using System.Text.Json.Serialization.Metadata; +using UseSourceGeneration.Client; + +namespace UseSourceGeneration.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty) : base() + { + SomeProperty = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string? someProperty = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "someProperty": + someProperty = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (someProperty == null) + throw new ArgumentNullException(nameof(someProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } + + /// + /// The TestInlineFreeformAdditionalPropertiesRequestSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(TestInlineFreeformAdditionalPropertiesRequest))] + public partial class TestInlineFreeformAdditionalPropertiesRequestSerializationContext : JsonSerializerContext { } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES index 87a3af64050..1179de6767b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES @@ -91,6 +91,7 @@ docs/models/SpecialModelName.md docs/models/Tag.md docs/models/TestCollectionEndingWithWordList.md docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -217,6 +218,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md index c21c791fe24..76873f715c8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs index 49359123e35..63d04a3c1ed 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs @@ -384,6 +384,29 @@ namespace Org.OpenAPITools.Api /// Task<ApiResponse>object>?> Task?> TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>object>?> + Task?> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + /// /// test json serialization of form data /// @@ -715,6 +738,26 @@ namespace Org.OpenAPITools.Api OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler>? OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(ApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2946,6 +2989,148 @@ namespace Org.OpenAPITools.Api } } + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = HttpMethod.Post; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ApiResponse apiResponseLocalVar = new ApiResponse(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + partial void FormatTestJsonFormData(ref string param, ref string param2); /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs index 927a2c06f2b..968417a9e74 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -128,6 +128,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new TagJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..95ad0601f97 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,175 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty) : base() + { + SomeProperty = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string? someProperty = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "someProperty": + someProperty = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (someProperty == null) + throw new ArgumentNullException(nameof(someProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES index 87a3af64050..1179de6767b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES @@ -91,6 +91,7 @@ docs/models/SpecialModelName.md docs/models/Tag.md docs/models/TestCollectionEndingWithWordList.md docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -217,6 +218,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md index c21c791fe24..76873f715c8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs index 5b8352b1943..6ffdaac74e3 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -382,6 +382,29 @@ namespace Org.OpenAPITools.Api /// Task<ApiResponse>object>> Task> TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>object>> + Task> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + /// /// test json serialization of form data /// @@ -713,6 +736,26 @@ namespace Org.OpenAPITools.Api OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler> OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(ApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2944,6 +2987,148 @@ namespace Org.OpenAPITools.Api } } + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = HttpMethod.Post; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ApiResponse apiResponseLocalVar = new ApiResponse(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + partial void FormatTestJsonFormData(ref string param, ref string param2); /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs index ae2f48b2b79..5ea9415eba0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -126,6 +126,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new TagJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..139e92b4c6a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,173 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty) : base() + { + SomeProperty = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string someProperty = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "someProperty": + someProperty = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (someProperty == null) + throw new ArgumentNullException(nameof(someProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES index 87a3af64050..1179de6767b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES @@ -91,6 +91,7 @@ docs/models/SpecialModelName.md docs/models/Tag.md docs/models/TestCollectionEndingWithWordList.md docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -217,6 +218,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md index c21c791fe24..76873f715c8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs index b7ed8d0447c..b3c97b9d368 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -382,6 +382,29 @@ namespace Org.OpenAPITools.Api /// Task<ApiResponse>object>> Task> TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<object>> + Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>object>> + Task> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + /// /// test json serialization of form data /// @@ -713,6 +736,26 @@ namespace Org.OpenAPITools.Api OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler> OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(ApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2936,6 +2979,148 @@ namespace Org.OpenAPITools.Api } } + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ApiResponse apiResponseLocalVar = new ApiResponse(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + partial void FormatTestJsonFormData(ref string param, ref string param2); /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs index 5e1acbfcca4..964d9c24a14 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -126,6 +126,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new TagJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..139e92b4c6a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,173 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty) : base() + { + SomeProperty = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string someProperty = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "someProperty": + someProperty = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (someProperty == null) + throw new ArgumentNullException(nameof(someProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES index c92eb8a6fd4..cfa6edb1db8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -206,6 +207,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md index 279521a393b..18aa6dd26bc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md @@ -147,6 +147,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -257,6 +258,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md index af0db86acfe..bd9b0d42c22 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1257,6 +1258,95 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new FakeApi(httpClient, config, httpClientHandler); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs index 6beca60b3bf..14104f06bee 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -339,6 +339,24 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -754,6 +772,29 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -2773,6 +2814,119 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..03f440cf19a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES index e52637ec329..ddeca89d213 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -209,6 +210,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/README.md b/samples/client/petstore/csharp/OpenAPIClient-net47/README.md index dc0b4a8a5be..2a3e242fe88 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/README.md @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -244,6 +245,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md index 9c646838c3d..c8a21d2e25c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs index aef969f7935..7282ba7821b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs @@ -365,6 +365,26 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody, int operationIndex = 0); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -810,6 +830,31 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -3093,6 +3138,148 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..e668ef1fe4e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES index e52637ec329..ddeca89d213 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -209,6 +210,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/README.md b/samples/client/petstore/csharp/OpenAPIClient-net48/README.md index dc0b4a8a5be..2a3e242fe88 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/README.md @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -244,6 +245,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md index 9c646838c3d..c8a21d2e25c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs index aef969f7935..7282ba7821b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs @@ -365,6 +365,26 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody, int operationIndex = 0); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -810,6 +830,31 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -3093,6 +3138,148 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..e668ef1fe4e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES index e52637ec329..ddeca89d213 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -209,6 +210,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md index dc0b4a8a5be..2a3e242fe88 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -244,6 +245,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/FakeApi.md index 7d94cce2029..70d7da71e1c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs index 0ebf9df8a61..afe11803933 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -365,6 +365,26 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody, int operationIndex = 0); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -810,6 +830,31 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -3093,6 +3138,148 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..e668ef1fe4e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES index 7f410e395d7..b6dffff4f19 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES @@ -88,6 +88,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -205,6 +206,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md index b4ded59815d..dcfb2967818 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md @@ -108,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -218,6 +219,7 @@ Class | Method | HTTP request | Description - [Model.Tag](Tag.md) - [Model.TestCollectionEndingWithWordList](TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](Triangle.md) - [Model.TriangleInterface](TriangleInterface.md) - [Model.User](User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md index 9c646838c3d..c8a21d2e25c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..15877ca6d71 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Test] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Test] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs index b679e625cde..fa822317a0b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs @@ -338,6 +338,24 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -753,6 +771,29 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -2844,6 +2885,130 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..f4048c333a2 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TestInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.SomeProperty == input.SomeProperty || + (this.SomeProperty != null && + this.SomeProperty.Equals(input.SomeProperty)) + ) + && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES index 526fb785222..f69e6ba1aba 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -208,6 +209,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index 50e6c8e215c..af827f28641 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -122,6 +122,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -232,6 +233,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 9c646838c3d..c8a21d2e25c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClient/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} 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 aef969f7935..7282ba7821b 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 @@ -365,6 +365,26 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody, int operationIndex = 0); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -810,6 +830,31 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -3093,6 +3138,148 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..e668ef1fe4e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES index 526fb785222..f69e6ba1aba 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES @@ -90,6 +90,7 @@ docs/StoreApi.md docs/Tag.md docs/TestCollectionEndingWithWordList.md docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -208,6 +209,7 @@ src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/README.md b/samples/client/petstore/csharp/OpenAPIClientCore/README.md index dc0b4a8a5be..2a3e242fe88 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientCore/README.md @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -244,6 +245,7 @@ Class | Method | HTTP request | Description - [Model.Tag](docs/Tag.md) - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml index 45616d427fb..f6eeaf555f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml @@ -943,6 +943,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2488,6 +2505,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md index 7d94cce2029..70d7da71e1c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**TestInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | @@ -1205,6 +1206,91 @@ No authorization required - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/OpenAPIClientCore/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c1cf9ce2f81 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..435d4630ee7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 0ebf9df8a61..afe11803933 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -365,6 +365,26 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody, int operationIndex = 0); /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0); + /// /// test json serialization of form data /// /// Thrown when fails to make API call @@ -810,6 +830,31 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test json serialization of form data /// /// @@ -3093,6 +3138,148 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(testInlineFreeformAdditionalPropertiesRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineFreeformAdditionalPropertiesWithHttpInfoAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling FakeApi->TestInlineFreeformAdditionalProperties"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = testInlineFreeformAdditionalPropertiesRequest; + + localVarRequestOptions.Operation = "FakeApi.TestInlineFreeformAdditionalProperties"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-freeform-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineFreeformAdditionalProperties", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test json serialization of form data /// diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..e668ef1fe4e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + [DataContract(Name = "testInlineFreeformAdditionalProperties_request")] + public partial class TestInlineFreeformAdditionalPropertiesRequest : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty. + public TestInlineFreeformAdditionalPropertiesRequest(string someProperty = default(string)) : base() + { + this.SomeProperty = someProperty; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets SomeProperty + /// + [DataMember(Name = "someProperty", EmitDefaultValue = false)] + public string SomeProperty { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestInlineFreeformAdditionalPropertiesRequest).AreEqual; + } + + /// + /// Returns true if TestInlineFreeformAdditionalPropertiesRequest instances are equal + /// + /// Instance of TestInlineFreeformAdditionalPropertiesRequest to be compared + /// Boolean + public bool Equals(TestInlineFreeformAdditionalPropertiesRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.SomeProperty != null) + { + hashCode = (hashCode * 59) + this.SomeProperty.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/elixir/.openapi-generator/FILES b/samples/client/petstore/elixir/.openapi-generator/FILES index 4e11f3ad074..aadc7af9aa6 100644 --- a/samples/client/petstore/elixir/.openapi-generator/FILES +++ b/samples/client/petstore/elixir/.openapi-generator/FILES @@ -60,6 +60,7 @@ lib/openapi_petstore/model/read_only_first.ex lib/openapi_petstore/model/return.ex lib/openapi_petstore/model/single_ref_type.ex lib/openapi_petstore/model/tag.ex +lib/openapi_petstore/model/test_inline_freeform_additional_properties_request.ex lib/openapi_petstore/model/user.ex lib/openapi_petstore/request_builder.ex mix.exs diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 250ad1f6656..e21cc6d51d4 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -585,6 +585,37 @@ defmodule OpenapiPetstore.Api.Fake do ]) end + @doc """ + test inline free-form additionalProperties + + + ### Parameters + + - `connection` (OpenapiPetstore.Connection): Connection to server + - `test_inline_freeform_additional_properties_request` (TestInlineFreeformAdditionalPropertiesRequest): request body + - `opts` (keyword): Optional parameters + + ### Returns + + - `{:ok, nil}` on success + - `{:error, Tesla.Env.t}` on failure + """ + @spec test_inline_freeform_additional_properties(Tesla.Env.client, OpenapiPetstore.Model.TestInlineFreeformAdditionalPropertiesRequest.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_inline_freeform_additional_properties(connection, test_inline_freeform_additional_properties_request, _opts \\ []) do + request = + %{} + |> method(:post) + |> url("/fake/inline-freeform-additionalProperties") + |> add_param(:body, :body, test_inline_freeform_additional_properties_request) + |> Enum.into([]) + + connection + |> Connection.request(request) + |> evaluate_response([ + {200, false} + ]) + end + @doc """ test json serialization of form data diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/test_inline_freeform_additional_properties_request.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/test_inline_freeform_additional_properties_request.ex new file mode 100644 index 00000000000..f3d735d1d70 --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/test_inline_freeform_additional_properties_request.ex @@ -0,0 +1,22 @@ +# NOTE: This file is auto generated by OpenAPI Generator 7.1.0-SNAPSHOT (https://openapi-generator.tech). +# Do not edit this file manually. + +defmodule OpenapiPetstore.Model.TestInlineFreeformAdditionalPropertiesRequest do + @moduledoc """ + + """ + + @derive Jason.Encoder + defstruct [ + :someProperty + ] + + @type t :: %__MODULE__{ + :someProperty => String.t | nil + } + + def decode(value) do + value + end +end + diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES index 697bbc6ddab..11d4e6e441f 100644 --- a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES @@ -53,6 +53,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md pom.xml @@ -115,4 +116,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md index 5ad01909152..7f7a569f2b4 100644 --- a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -605,6 +606,41 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > void testJsonFormData(param, param2) diff --git a/samples/client/petstore/java-helidon-client/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java-helidon-client/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java index 89484f30f6c..533c19442d5 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -38,6 +38,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; /** @@ -161,6 +162,15 @@ public interface FakeApi { @Consumes({ "application/json" }) void testInlineAdditionalProperties(Map requestBody) throws ApiException, ProcessingException; + /** + * test inline free-form additionalProperties + * + */ + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException, ProcessingException; + /** * test json serialization of form data * diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..e46c4bb382d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + **/ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..4283de111c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES index e94daa98539..29efd849bdd 100644 --- a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES @@ -53,6 +53,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md pom.xml @@ -124,4 +125,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java-helidon-client/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java-helidon-client/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java index d1c8dd114ec..dc7a20295b5 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java @@ -28,6 +28,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; /** @@ -136,6 +137,14 @@ public interface FakeApi { */ ApiResponse testInlineAdditionalProperties(Map requestBody); + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + /** * test json serialization of form data * diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java index ae2bdc30f22..db9dce74ca3 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -44,6 +44,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.ArrayList; import org.openapitools.client.Pair; @@ -75,6 +76,7 @@ public class FakeApiImpl implements FakeApi { protected static final GenericType RESPONSE_TYPE_testEnumParameters = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testGroupParameters = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testInlineAdditionalProperties = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testInlineFreeformAdditionalProperties = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testJsonFormData = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testNullable = ResponseType.create(Void.class); protected static final GenericType RESPONSE_TYPE_testQueryParameterCollectionFormat = ResponseType.create(Void.class); @@ -813,6 +815,44 @@ public class FakeApiImpl implements FakeApi { return ApiResponse.create(RESPONSE_TYPE_testInlineAdditionalProperties, webClientResponse); } + @Override + public ApiResponse testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + Objects.requireNonNull(testInlineFreeformAdditionalPropertiesRequest, "Required parameter 'testInlineFreeformAdditionalPropertiesRequest' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest); + return testInlineFreeformAdditionalPropertiesSubmit(webClientRequestBuilder, testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testInlineFreeformAdditionalProperties operation. + * Optional customization point for subclasses. + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return WebClientRequestBuilder for testInlineFreeformAdditionalProperties + */ + protected WebClientRequestBuilder testInlineFreeformAdditionalPropertiesRequestBuilder(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/inline-freeform-additionalProperties"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testInlineFreeformAdditionalProperties operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testInlineFreeformAdditionalPropertiesSubmit(WebClientRequestBuilder webClientRequestBuilder, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + Single webClientResponse = webClientRequestBuilder.submit(testInlineFreeformAdditionalPropertiesRequest); + return ApiResponse.create(RESPONSE_TYPE_testInlineFreeformAdditionalProperties, webClientResponse); + } + @Override public ApiResponse testJsonFormData(String param, String param2) { Objects.requireNonNull(param, "Required parameter 'param' not specified"); diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..e46c4bb382d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + **/ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..4283de111c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES index c3b1e93a673..7d97913fdf9 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -140,4 +141,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index 400434d7e49..fa0d4f88db0 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -124,6 +124,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -201,6 +202,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/apache-httpclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/apache-httpclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java index c649052dd86..de6b83f45ac 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -32,6 +32,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; @@ -1297,6 +1298,77 @@ if (booleanGroup != null) + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null + ); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException if fails to make API call + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + this.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, Collections.emptyMap()); + } + + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map additionalHeaders) throws ApiException { + Object localVarPostBody = testInlineFreeformAdditionalPropertiesRequest; + + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + // create path and map variables + String localVarPath = "/fake/inline-freeform-additionalProperties"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + final String[] localVarAccepts = { }; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..171d09bfc09 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,157 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `someProperty` to the URL query string + if (getSomeProperty() != null) { + try { + joiner.add(String.format("%ssomeProperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeProperty()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES index 995a090dcb2..fe92d027a7a 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -87,4 +87,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: 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 56dec984095..1d216f59627 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 @@ -17,6 +17,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.ArrayList; @@ -811,6 +812,33 @@ public interface FakeApi extends ApiClient.Api { + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + */ + @RequestLine("POST /fake/inline-freeform-additionalProperties") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /** + * test inline free-form additionalProperties + * Similar to testInlineFreeformAdditionalProperties but it also returns the http response headers . + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + */ + @RequestLine("POST /fake/inline-freeform-additionalProperties") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + + /** * test json serialization of form data * diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..7bdd9d04da7 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,157 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..c6b20466d6f --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/jersey3/.openapi-generator/FILES b/samples/client/petstore/java/jersey3/.openapi-generator/FILES index d3d27bc86c3..4fbcb8fd20b 100644 --- a/samples/client/petstore/java/jersey3/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey3/.openapi-generator/FILES @@ -79,6 +79,7 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -188,6 +189,7 @@ src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/Triangle.java src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 06d6093a230..a4946d81fb5 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -128,6 +128,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -224,6 +225,7 @@ Class | Method | HTTP request | Description - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Triangle](docs/Triangle.md) - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml index 82435d1c056..2dcf21ae0b3 100644 --- a/samples/client/petstore/java/jersey3/api/openapi.yaml +++ b/samples/client/petstore/java/jersey3/api/openapi.yaml @@ -958,6 +958,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2284,6 +2303,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/jersey3/docs/FakeApi.md b/samples/client/petstore/java/jersey3/docs/FakeApi.md index 0663bb791e4..83f469863c9 100644 --- a/samples/client/petstore/java/jersey3/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey3/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -928,6 +929,70 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.model.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/jersey3/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/jersey3/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/jersey3/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java index 6ac9438f44b..9bf3abd9fbe 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -17,6 +17,7 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.ArrayList; @@ -775,6 +776,45 @@ private ApiResponse testGroupParametersWithHttpInfo(Integer requiredString new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, null, null, false); } + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + // Check required parameters + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testInlineFreeformAdditionalProperties", "/fake/inline-freeform-additionalProperties", "POST", new ArrayList<>(), testInlineFreeformAdditionalPropertiesRequest, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..94854aa2693 --- /dev/null +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this testInlineFreeformAdditionalProperties_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..556aaa00c72 --- /dev/null +++ b/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/native-async/.openapi-generator/FILES b/samples/client/petstore/java/native-async/.openapi-generator/FILES index e9f85bd9da8..ed0ac7f107b 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-async/.openapi-generator/FILES @@ -80,6 +80,7 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -181,6 +182,7 @@ src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/Triangle.java src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/native-async/README.md b/samples/client/petstore/java/native-async/README.md index 9a850bd9ff1..5bbd36da000 100644 --- a/samples/client/petstore/java/native-async/README.md +++ b/samples/client/petstore/java/native-async/README.md @@ -138,6 +138,8 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParametersWithHttpInfo**](docs/FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testInlineAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testJsonFormDataWithHttpInfo**](docs/FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -259,6 +261,7 @@ Class | Method | HTTP request | Description - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Triangle](docs/Triangle.md) - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index a46f3a68fd8..79127951b04 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -973,6 +973,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2310,6 +2329,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/native-async/docs/FakeApi.md b/samples/client/petstore/java/native-async/docs/FakeApi.md index eabbd418b17..5ad79f6eba2 100644 --- a/samples/client/petstore/java/native-async/docs/FakeApi.md +++ b/samples/client/petstore/java/native-async/docs/FakeApi.md @@ -32,6 +32,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | | [**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -2144,6 +2146,147 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> CompletableFuture testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + CompletableFuture result = apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testInlineFreeformAdditionalPropertiesWithHttpInfo + +> CompletableFuture> testInlineFreeformAdditionalProperties testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + CompletableFuture> response = apiInstance.testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > CompletableFuture testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/native-async/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/native-async/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java index f4c1e581743..c3a4b4bbede 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java @@ -27,6 +27,7 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; @@ -1629,6 +1630,89 @@ public class FakeApi { } return localVarRequestBuilder; } + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return CompletableFuture<Void> + * @throws ApiException if fails to make API call + */ + public CompletableFuture testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testInlineFreeformAdditionalProperties", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testInlineFreeformAdditionalProperties", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/inline-freeform-additionalProperties"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(testInlineFreeformAdditionalPropertiesRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..a131be6db0e --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this testInlineFreeformAdditionalProperties_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `someProperty` to the URL query string + if (getSomeProperty() != null) { + joiner.add(String.format("%ssomeProperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..7ab59f334f2 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/native/.openapi-generator/FILES b/samples/client/petstore/java/native/.openapi-generator/FILES index e9f85bd9da8..ed0ac7f107b 100644 --- a/samples/client/petstore/java/native/.openapi-generator/FILES +++ b/samples/client/petstore/java/native/.openapi-generator/FILES @@ -80,6 +80,7 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -181,6 +182,7 @@ src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/Triangle.java src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/native/README.md b/samples/client/petstore/java/native/README.md index 7b563c172f6..c0ada1a69cc 100644 --- a/samples/client/petstore/java/native/README.md +++ b/samples/client/petstore/java/native/README.md @@ -137,6 +137,8 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParametersWithHttpInfo**](docs/FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testInlineAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testJsonFormDataWithHttpInfo**](docs/FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -258,6 +260,7 @@ Class | Method | HTTP request | Description - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Triangle](docs/Triangle.md) - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index a46f3a68fd8..79127951b04 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -973,6 +973,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2310,6 +2329,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index e8911736308..d741761672d 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -32,6 +32,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | | [**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -2018,6 +2020,138 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testInlineFreeformAdditionalPropertiesWithHttpInfo + +> ApiResponse testInlineFreeformAdditionalProperties testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + ApiResponse response = apiInstance.testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > void testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/native/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/native/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/native/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 8467f9efe65..8a8b89d22ad 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -27,6 +27,7 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; @@ -1441,6 +1442,86 @@ public class FakeApi { } return localVarRequestBuilder; } + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException if fails to make API call + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testInlineFreeformAdditionalProperties", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/inline-freeform-additionalProperties"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(testInlineFreeformAdditionalPropertiesRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..a131be6db0e --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this testInlineFreeformAdditionalProperties_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `someProperty` to the URL query string + if (getSomeProperty() != null) { + joiner.add(String.format("%ssomeProperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..7ab59f334f2 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index aebc1680656..c164cd913e3 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -89,6 +89,7 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -215,6 +216,7 @@ src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/Triangle.java src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 8b0c31d27db..4b2ed954eaf 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -238,6 +239,7 @@ Class | Method | HTTP request | Description - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Triangle](docs/Triangle.md) - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index b6e37f7b6fc..75e2a80fee9 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -954,6 +954,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2533,6 +2552,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index a42a16e0746..bbfe7c1b97e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -18,6 +18,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -940,6 +941,67 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +# **testInlineFreeformAdditionalProperties** +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/okhttp-gson/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/okhttp-gson/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index 6b93a63176a..dc729b10c5e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -300,6 +300,7 @@ public class JSON { gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SimpleQuadrilateral.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SpecialModelName.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Triangle.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TriangleInterface.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()); 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 a06829a2481..3f048ddf6a2 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 @@ -36,6 +36,7 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.lang.reflect.Type; @@ -2057,6 +2058,124 @@ public class FakeApi { localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for testInlineFreeformAdditionalProperties + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public okhttp3.Call testInlineFreeformAdditionalPropertiesCall(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = testInlineFreeformAdditionalPropertiesRequest; + + // create path and map variables + String localVarPath = "/fake/inline-freeform-additionalProperties"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testInlineFreeformAdditionalPropertiesValidateBeforeCall(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties(Async)"); + } + + return testInlineFreeformAdditionalPropertiesCall(testInlineFreeformAdditionalPropertiesRequest, _callback); + + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + okhttp3.Call localVarCall = testInlineFreeformAdditionalPropertiesValidateBeforeCall(testInlineFreeformAdditionalPropertiesRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * test inline free-form additionalProperties (asynchronously) + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public okhttp3.Call testInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testInlineFreeformAdditionalPropertiesValidateBeforeCall(testInlineFreeformAdditionalPropertiesRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } /** * Build call for testJsonFormData * @param param field1 (required) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..6aa03af08bc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,284 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest { + public static final String SERIALIZED_NAME_SOME_PROPERTY = "someProperty"; + @SerializedName(SERIALIZED_NAME_SOME_PROPERTY) + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + public String getSomeProperty() { + return someProperty; + } + + + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TestInlineFreeformAdditionalPropertiesRequest instance itself + */ + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("someProperty"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TestInlineFreeformAdditionalPropertiesRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TestInlineFreeformAdditionalPropertiesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TestInlineFreeformAdditionalPropertiesRequest is not found in the empty JSON string", TestInlineFreeformAdditionalPropertiesRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("someProperty") != null && !jsonObj.get("someProperty").isJsonNull()) && !jsonObj.get("someProperty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `someProperty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("someProperty").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TestInlineFreeformAdditionalPropertiesRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TestInlineFreeformAdditionalPropertiesRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TestInlineFreeformAdditionalPropertiesRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TestInlineFreeformAdditionalPropertiesRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TestInlineFreeformAdditionalPropertiesRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TestInlineFreeformAdditionalPropertiesRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TestInlineFreeformAdditionalPropertiesRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TestInlineFreeformAdditionalPropertiesRequest + * @throws IOException if the JSON string is invalid with respect to TestInlineFreeformAdditionalPropertiesRequest + */ + public static TestInlineFreeformAdditionalPropertiesRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TestInlineFreeformAdditionalPropertiesRequest.class); + } + + /** + * Convert an instance of TestInlineFreeformAdditionalPropertiesRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..e587ccea6ea --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/FILES b/samples/client/petstore/java/resteasy/.openapi-generator/FILES index 5268fd94f53..89d81862bef 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/FILES +++ b/samples/client/petstore/java/resteasy/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -141,4 +142,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/resteasy/README.md b/samples/client/petstore/java/resteasy/README.md index 45e1a1c959b..88c593489c7 100644 --- a/samples/client/petstore/java/resteasy/README.md +++ b/samples/client/petstore/java/resteasy/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/resteasy/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/resteasy/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [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 c9bee15e56f..f9093377f76 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 @@ -20,6 +20,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.ArrayList; @@ -787,6 +788,48 @@ if (booleanGroup != null) + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException if fails to make API call + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + Object localVarPostBody = testInlineFreeformAdditionalPropertiesRequest; + + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + // create path and map variables + String localVarPath = "/fake/inline-freeform-additionalProperties".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { }; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..1c27f9f0afd --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES index 66e0488958e..85c267f9f86 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -136,4 +137,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/resttemplate-withXml/README.md b/samples/client/petstore/java/resttemplate-withXml/README.md index dc708dba258..aef90cd7fba 100644 --- a/samples/client/petstore/java/resttemplate-withXml/README.md +++ b/samples/client/petstore/java/resttemplate-withXml/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/resttemplate-withXml/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [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 0ed0c08ed19..c816078d248 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 @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.Collections; @@ -915,6 +916,51 @@ public class FakeApi { ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientException { + Object localVarPostBody = testInlineFreeformAdditionalPropertiesRequest; + + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..0a7c50e8f17 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,119 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; +import javax.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@XmlRootElement(name = "TestInlineFreeformAdditionalPropertiesRequest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TestInlineFreeformAdditionalPropertiesRequest") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + @XmlElement(name = "someProperty") + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "someProperty") + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "someProperty") + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES index 66e0488958e..85c267f9f86 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -136,4 +137,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/resttemplate/README.md b/samples/client/petstore/java/resttemplate/README.md index c2f1a0109a6..24053b816ed 100644 --- a/samples/client/petstore/java/resttemplate/README.md +++ b/samples/client/petstore/java/resttemplate/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/resttemplate/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/resttemplate/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [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 0ed0c08ed19..c816078d248 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 @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.Collections; @@ -915,6 +916,51 @@ public class FakeApi { ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientException { + Object localVarPostBody = testInlineFreeformAdditionalPropertiesRequest; + + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..1c27f9f0afd --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/vertx/.openapi-generator/FILES b/samples/client/petstore/java/vertx/.openapi-generator/FILES index 78449bae3e4..bb3ea604f06 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/FILES +++ b/samples/client/petstore/java/vertx/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -154,4 +155,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/vertx/README.md b/samples/client/petstore/java/vertx/README.md index bc346e08dd2..1cab57b4f6c 100644 --- a/samples/client/petstore/java/vertx/README.md +++ b/samples/client/petstore/java/vertx/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index d17031d2ac1..b9dc1bfbd92 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/vertx/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/vertx/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [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 ac4bf8941f6..f0768854f80 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 @@ -14,6 +14,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -87,6 +88,10 @@ public interface FakeApi { void testInlineAdditionalProperties(Map requestBody, ApiClient.AuthInfo authInfo, Handler> handler); + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Handler> handler); + + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, ApiClient.AuthInfo authInfo, Handler> handler); + void testJsonFormData(String param, String param2, Handler> handler); void testJsonFormData(String param, String param2, ApiClient.AuthInfo authInfo, 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 34c098a50fb..88734181cfc 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 @@ -13,6 +13,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; @@ -907,6 +908,54 @@ if (booleanGroup != null) apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param resultHandler Asynchronous result handler + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Handler> resultHandler) { + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, null, resultHandler); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + Object localVarBody = testInlineFreeformAdditionalPropertiesRequest; + + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties")); + return; + } + + // create path and map variables + String localVarPath = "/fake/inline-freeform-additionalProperties"; + + // query params + List localVarQueryParams = new ArrayList<>(); + + // header params + MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); + + // cookie params + MultiMap localVarCookieParams = MultiMap.caseInsensitiveMultiMap(); + + // form params + // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) + Map localVarFormParams = new HashMap<>(); + + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "application/json" }; + String[] localVarAuthNames = new String[] { }; + + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); + } + /** * test json serialization of form data * * @param param field1 (required) 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 4ae404ab093..f5537a272c9 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 @@ -13,6 +13,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; @@ -864,6 +865,51 @@ public class FakeApi { )); } /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param resultHandler Asynchronous result handler + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Handler> resultHandler) { + delegate.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, resultHandler); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, authInfo, resultHandler); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, fut) + )); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, authInfo, fut) + )); + } + /** * test json serialization of form data * * @param param field1 (required) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..1c27f9f0afd --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES b/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES index cf2db2afaf1..fcdb2bc3222 100644 --- a/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -137,4 +138,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index 178a016bffe..a88a5413c4f 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/webclient-jakarta/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/webclient-jakarta/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java index 35ad9b29bca..4eda70f5a0c 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/api/FakeApi.java @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.HashMap; @@ -1368,6 +1369,75 @@ public class FakeApi { public ResponseSpec testInlineAdditionalPropertiesWithResponseSpec(Map requestBody) throws WebClientResponseException { return testInlineAdditionalPropertiesRequestCreation(requestBody); } + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineFreeformAdditionalPropertiesRequestCreation(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + Object postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).bodyToMono(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).toEntity(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineFreeformAdditionalPropertiesWithResponseSpec(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest); + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..70718086560 --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/webclient-swagger2/.openapi-generator/FILES b/samples/client/petstore/java/webclient-swagger2/.openapi-generator/FILES index cf2db2afaf1..fcdb2bc3222 100644 --- a/samples/client/petstore/java/webclient-swagger2/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient-swagger2/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -137,4 +138,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient-swagger2/README.md b/samples/client/petstore/java/webclient-swagger2/README.md index 178a016bffe..a88a5413c4f 100644 --- a/samples/client/petstore/java/webclient-swagger2/README.md +++ b/samples/client/petstore/java/webclient-swagger2/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml b/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md b/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/webclient-swagger2/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/webclient-swagger2/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/webclient-swagger2/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java index da027dbd509..a7602fbaff3 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.HashMap; @@ -1368,6 +1369,75 @@ public class FakeApi { public ResponseSpec testInlineAdditionalPropertiesWithResponseSpec(Map requestBody) throws WebClientResponseException { return testInlineAdditionalPropertiesRequestCreation(requestBody); } + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineFreeformAdditionalPropertiesRequestCreation(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + Object postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).bodyToMono(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).toEntity(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineFreeformAdditionalPropertiesWithResponseSpec(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest); + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..24195e24320 --- /dev/null +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..1a95f95a218 --- /dev/null +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/webclient/.openapi-generator/FILES b/samples/client/petstore/java/webclient/.openapi-generator/FILES index cf2db2afaf1..fcdb2bc3222 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -137,4 +138,5 @@ src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md index 178a016bffe..a88a5413c4f 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -131,6 +131,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -208,6 +209,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/SingleRefType.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 288d4890902..991caf59001 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index df8b14be8e2..e442af92c3b 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1133,6 +1134,71 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/webclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/webclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [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 da027dbd509..a7602fbaff3 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 @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.HashMap; @@ -1368,6 +1369,75 @@ public class FakeApi { public ResponseSpec testInlineAdditionalPropertiesWithResponseSpec(Map requestBody) throws WebClientResponseException { return testInlineAdditionalPropertiesRequestCreation(requestBody); } + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineFreeformAdditionalPropertiesRequestCreation(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + Object postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).bodyToMono(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).toEntity(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineFreeformAdditionalPropertiesWithResponseSpec(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws WebClientResponseException { + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest); + } /** * test json serialization of form data * diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..1c27f9f0afd --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..819a1e7fa9d --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/javascript-apollo/.openapi-generator/FILES b/samples/client/petstore/javascript-apollo/.openapi-generator/FILES index 9011fa6ed43..924fcc37feb 100644 --- a/samples/client/petstore/javascript-apollo/.openapi-generator/FILES +++ b/samples/client/petstore/javascript-apollo/.openapi-generator/FILES @@ -58,6 +58,7 @@ docs/SpecialModelName.md docs/StoreApi.md docs/StringOrBoolean.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -122,4 +123,5 @@ src/model/Return.js src/model/SpecialModelName.js src/model/StringOrBoolean.js src/model/Tag.js +src/model/TestInlineFreeformAdditionalPropertiesRequest.js src/model/User.js diff --git a/samples/client/petstore/javascript-apollo/README.md b/samples/client/petstore/javascript-apollo/README.md index db2c6ef4a40..96969380ac2 100644 --- a/samples/client/petstore/javascript-apollo/README.md +++ b/samples/client/petstore/javascript-apollo/README.md @@ -137,6 +137,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*OpenApiPetstore.FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -215,6 +216,7 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md) - [OpenApiPetstore.StringOrBoolean](docs/StringOrBoolean.md) - [OpenApiPetstore.Tag](docs/Tag.md) + - [OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [OpenApiPetstore.User](docs/User.md) diff --git a/samples/client/petstore/javascript-apollo/docs/FakeApi.md b/samples/client/petstore/javascript-apollo/docs/FakeApi.md index 5b76c0a7f50..b67ae97ad0d 100644 --- a/samples/client/petstore/javascript-apollo/docs/FakeApi.md +++ b/samples/client/petstore/javascript-apollo/docs/FakeApi.md @@ -19,6 +19,7 @@ Method | HTTP request | Description [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -773,6 +774,51 @@ No authorization required - **Accept**: Not defined +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let testInlineFreeformAdditionalPropertiesRequest = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body +apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript-apollo/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/javascript-apollo/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b8cf71f9cfc --- /dev/null +++ b/samples/client/petstore/javascript-apollo/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,9 @@ +# OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **String** | | [optional] + + diff --git a/samples/client/petstore/javascript-apollo/src/api/FakeApi.js b/samples/client/petstore/javascript-apollo/src/api/FakeApi.js index e1302f477b7..3cd15037199 100644 --- a/samples/client/petstore/javascript-apollo/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-apollo/src/api/FakeApi.js @@ -21,6 +21,7 @@ import HealthCheckResult from '../model/HealthCheckResult'; import OuterComposite from '../model/OuterComposite'; import OuterObjectWithEnumProperty from '../model/OuterObjectWithEnumProperty'; import Pet from '../model/Pet'; +import TestInlineFreeformAdditionalPropertiesRequest from '../model/TestInlineFreeformAdditionalPropertiesRequest'; import User from '../model/User'; /** @@ -645,6 +646,42 @@ export default class FakeApi extends ApiClient { ); } + /** + * test inline free-form additionalProperties + * + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} + * @return {Promise} + */ + async testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, requestInit) { + let postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest === undefined || testInlineFreeformAdditionalPropertiesRequest === null) { + throw new Error("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + 'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript', + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + + return this.callApi( + '/fake/inline-freeform-additionalProperties', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, requestInit + ); + } + /** * test json serialization of form data * diff --git a/samples/client/petstore/javascript-apollo/src/index.js b/samples/client/petstore/javascript-apollo/src/index.js index 2783bffde76..45ff0ffe2e3 100644 --- a/samples/client/petstore/javascript-apollo/src/index.js +++ b/samples/client/petstore/javascript-apollo/src/index.js @@ -63,6 +63,7 @@ import Return from './model/Return'; import SpecialModelName from './model/SpecialModelName'; import StringOrBoolean from './model/StringOrBoolean'; import Tag from './model/Tag'; +import TestInlineFreeformAdditionalPropertiesRequest from './model/TestInlineFreeformAdditionalPropertiesRequest'; import User from './model/User'; import AnotherFakeApi from './api/AnotherFakeApi'; import DefaultApi from './api/DefaultApi'; @@ -411,6 +412,12 @@ export { */ Tag, + /** + * The TestInlineFreeformAdditionalPropertiesRequest model constructor. + * @property {module:model/TestInlineFreeformAdditionalPropertiesRequest} + */ + TestInlineFreeformAdditionalPropertiesRequest, + /** * The User model constructor. * @property {module:model/User} diff --git a/samples/client/petstore/javascript-apollo/src/model/TestInlineFreeformAdditionalPropertiesRequest.js b/samples/client/petstore/javascript-apollo/src/model/TestInlineFreeformAdditionalPropertiesRequest.js new file mode 100644 index 00000000000..b28db6e166f --- /dev/null +++ b/samples/client/petstore/javascript-apollo/src/model/TestInlineFreeformAdditionalPropertiesRequest.js @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The TestInlineFreeformAdditionalPropertiesRequest model module. + * @module model/TestInlineFreeformAdditionalPropertiesRequest + * @version 1.0.0 + */ +class TestInlineFreeformAdditionalPropertiesRequest { + /** + * Constructs a new TestInlineFreeformAdditionalPropertiesRequest. + * @alias module:model/TestInlineFreeformAdditionalPropertiesRequest + * @extends Object + */ + constructor() { + + TestInlineFreeformAdditionalPropertiesRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a TestInlineFreeformAdditionalPropertiesRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} obj Optional instance to populate. + * @return {module:model/TestInlineFreeformAdditionalPropertiesRequest} The populated TestInlineFreeformAdditionalPropertiesRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TestInlineFreeformAdditionalPropertiesRequest(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('someProperty')) { + obj['someProperty'] = ApiClient.convertToType(data['someProperty'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to TestInlineFreeformAdditionalPropertiesRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to TestInlineFreeformAdditionalPropertiesRequest. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['someProperty'] && !(typeof data['someProperty'] === 'string' || data['someProperty'] instanceof String)) { + throw new Error("Expected the field `someProperty` to be a primitive type in the JSON string but got " + data['someProperty']); + } + + return true; + } + + +} + + + +/** + * @member {String} someProperty + */ +TestInlineFreeformAdditionalPropertiesRequest.prototype['someProperty'] = undefined; + + + + + + +export default TestInlineFreeformAdditionalPropertiesRequest; + diff --git a/samples/client/petstore/javascript-apollo/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js b/samples/client/petstore/javascript-apollo/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js new file mode 100644 index 00000000000..7ce7731bf57 --- /dev/null +++ b/samples/client/petstore/javascript-apollo/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TestInlineFreeformAdditionalPropertiesRequest', function() { + it('should create an instance of TestInlineFreeformAdditionalPropertiesRequest', function() { + // uncomment below and update the code to test TestInlineFreeformAdditionalPropertiesRequest + //var instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + //expect(instance).to.be.a(OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest); + }); + + it('should have the property someProperty (base name: "someProperty")', function() { + // uncomment below and update the code to test the property someProperty + //var instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/FILES b/samples/client/petstore/javascript-es6/.openapi-generator/FILES index 65b22f216a7..30a49640bee 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/FILES +++ b/samples/client/petstore/javascript-es6/.openapi-generator/FILES @@ -58,6 +58,7 @@ docs/SpecialModelName.md docs/StoreApi.md docs/StringOrBoolean.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -122,4 +123,5 @@ src/model/Return.js src/model/SpecialModelName.js src/model/StringOrBoolean.js src/model/Tag.js +src/model/TestInlineFreeformAdditionalPropertiesRequest.js src/model/User.js diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 1f574fb0f35..f3aec1c96bf 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -137,6 +137,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*OpenApiPetstore.FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -215,6 +216,7 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md) - [OpenApiPetstore.StringOrBoolean](docs/StringOrBoolean.md) - [OpenApiPetstore.Tag](docs/Tag.md) + - [OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [OpenApiPetstore.User](docs/User.md) diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index a63ae962532..f1995011445 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -19,6 +19,7 @@ Method | HTTP request | Description [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -773,6 +774,51 @@ No authorization required - **Accept**: Not defined +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let testInlineFreeformAdditionalPropertiesRequest = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body +apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript-es6/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/javascript-es6/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b8cf71f9cfc --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,9 @@ +# OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **String** | | [optional] + + diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 151b1fc60ef..4d5bcd0b826 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -20,6 +20,7 @@ import HealthCheckStatus from '../model/HealthCheckStatus'; import OuterComposite from '../model/OuterComposite'; import OuterObjectWithEnumProperty from '../model/OuterObjectWithEnumProperty'; import Pet from '../model/Pet'; +import TestInlineFreeformAdditionalPropertiesRequest from '../model/TestInlineFreeformAdditionalPropertiesRequest'; import User from '../model/User'; /** @@ -728,6 +729,47 @@ export default class FakeApi { ); } + /** + * Callback function to receive the result of the testInlineFreeformAdditionalProperties operation. + * @callback module:api/FakeApi~testInlineFreeformAdditionalPropertiesCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * test inline free-form additionalProperties + * + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {module:api/FakeApi~testInlineFreeformAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response + */ + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, callback) { + let postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest === undefined || testInlineFreeformAdditionalPropertiesRequest === null) { + throw new Error("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/fake/inline-freeform-additionalProperties', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + /** * Callback function to receive the result of the testJsonFormData operation. * @callback module:api/FakeApi~testJsonFormDataCallback diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index 2466b0ebdab..20e75baed80 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -63,6 +63,7 @@ import Return from './model/Return'; import SpecialModelName from './model/SpecialModelName'; import StringOrBoolean from './model/StringOrBoolean'; import Tag from './model/Tag'; +import TestInlineFreeformAdditionalPropertiesRequest from './model/TestInlineFreeformAdditionalPropertiesRequest'; import User from './model/User'; import AnotherFakeApi from './api/AnotherFakeApi'; import DefaultApi from './api/DefaultApi'; @@ -411,6 +412,12 @@ export { */ Tag, + /** + * The TestInlineFreeformAdditionalPropertiesRequest model constructor. + * @property {module:model/TestInlineFreeformAdditionalPropertiesRequest} + */ + TestInlineFreeformAdditionalPropertiesRequest, + /** * The User model constructor. * @property {module:model/User} diff --git a/samples/client/petstore/javascript-es6/src/model/TestInlineFreeformAdditionalPropertiesRequest.js b/samples/client/petstore/javascript-es6/src/model/TestInlineFreeformAdditionalPropertiesRequest.js new file mode 100644 index 00000000000..b28db6e166f --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/TestInlineFreeformAdditionalPropertiesRequest.js @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The TestInlineFreeformAdditionalPropertiesRequest model module. + * @module model/TestInlineFreeformAdditionalPropertiesRequest + * @version 1.0.0 + */ +class TestInlineFreeformAdditionalPropertiesRequest { + /** + * Constructs a new TestInlineFreeformAdditionalPropertiesRequest. + * @alias module:model/TestInlineFreeformAdditionalPropertiesRequest + * @extends Object + */ + constructor() { + + TestInlineFreeformAdditionalPropertiesRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a TestInlineFreeformAdditionalPropertiesRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} obj Optional instance to populate. + * @return {module:model/TestInlineFreeformAdditionalPropertiesRequest} The populated TestInlineFreeformAdditionalPropertiesRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TestInlineFreeformAdditionalPropertiesRequest(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('someProperty')) { + obj['someProperty'] = ApiClient.convertToType(data['someProperty'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to TestInlineFreeformAdditionalPropertiesRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to TestInlineFreeformAdditionalPropertiesRequest. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['someProperty'] && !(typeof data['someProperty'] === 'string' || data['someProperty'] instanceof String)) { + throw new Error("Expected the field `someProperty` to be a primitive type in the JSON string but got " + data['someProperty']); + } + + return true; + } + + +} + + + +/** + * @member {String} someProperty + */ +TestInlineFreeformAdditionalPropertiesRequest.prototype['someProperty'] = undefined; + + + + + + +export default TestInlineFreeformAdditionalPropertiesRequest; + diff --git a/samples/client/petstore/javascript-es6/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js b/samples/client/petstore/javascript-es6/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js new file mode 100644 index 00000000000..7ce7731bf57 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TestInlineFreeformAdditionalPropertiesRequest', function() { + it('should create an instance of TestInlineFreeformAdditionalPropertiesRequest', function() { + // uncomment below and update the code to test TestInlineFreeformAdditionalPropertiesRequest + //var instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + //expect(instance).to.be.a(OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest); + }); + + it('should have the property someProperty (base name: "someProperty")', function() { + // uncomment below and update the code to test the property someProperty + //var instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES b/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES index 9011fa6ed43..924fcc37feb 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES @@ -58,6 +58,7 @@ docs/SpecialModelName.md docs/StoreApi.md docs/StringOrBoolean.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -122,4 +123,5 @@ src/model/Return.js src/model/SpecialModelName.js src/model/StringOrBoolean.js src/model/Tag.js +src/model/TestInlineFreeformAdditionalPropertiesRequest.js src/model/User.js diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index 41cd1ad2a0f..cbe9da562f0 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -135,6 +135,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*OpenApiPetstore.FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -213,6 +214,7 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md) - [OpenApiPetstore.StringOrBoolean](docs/StringOrBoolean.md) - [OpenApiPetstore.Tag](docs/Tag.md) + - [OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [OpenApiPetstore.User](docs/User.md) diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index e59d487ccfc..91964dffaa7 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -19,6 +19,7 @@ Method | HTTP request | Description [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -758,6 +759,50 @@ No authorization required - **Accept**: Not defined +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let testInlineFreeformAdditionalPropertiesRequest = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body +apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript-promise-es6/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/javascript-promise-es6/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b8cf71f9cfc --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,9 @@ +# OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **String** | | [optional] + + diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index d173cf111a4..15a2f60eb1d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -20,6 +20,7 @@ import HealthCheckResult from '../model/HealthCheckResult'; import OuterComposite from '../model/OuterComposite'; import OuterObjectWithEnumProperty from '../model/OuterObjectWithEnumProperty'; import Pet from '../model/Pet'; +import TestInlineFreeformAdditionalPropertiesRequest from '../model/TestInlineFreeformAdditionalPropertiesRequest'; import User from '../model/User'; /** @@ -837,6 +838,53 @@ export default class FakeApi { } + /** + * test inline free-form additionalProperties + * + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) { + let postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest === undefined || testInlineFreeformAdditionalPropertiesRequest === null) { + throw new Error("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/fake/inline-freeform-additionalProperties', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * test inline free-form additionalProperties + * + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) { + return this.testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + /** * test json serialization of form data * diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index 2783bffde76..45ff0ffe2e3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -63,6 +63,7 @@ import Return from './model/Return'; import SpecialModelName from './model/SpecialModelName'; import StringOrBoolean from './model/StringOrBoolean'; import Tag from './model/Tag'; +import TestInlineFreeformAdditionalPropertiesRequest from './model/TestInlineFreeformAdditionalPropertiesRequest'; import User from './model/User'; import AnotherFakeApi from './api/AnotherFakeApi'; import DefaultApi from './api/DefaultApi'; @@ -411,6 +412,12 @@ export { */ Tag, + /** + * The TestInlineFreeformAdditionalPropertiesRequest model constructor. + * @property {module:model/TestInlineFreeformAdditionalPropertiesRequest} + */ + TestInlineFreeformAdditionalPropertiesRequest, + /** * The User model constructor. * @property {module:model/User} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/TestInlineFreeformAdditionalPropertiesRequest.js b/samples/client/petstore/javascript-promise-es6/src/model/TestInlineFreeformAdditionalPropertiesRequest.js new file mode 100644 index 00000000000..b28db6e166f --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/TestInlineFreeformAdditionalPropertiesRequest.js @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The TestInlineFreeformAdditionalPropertiesRequest model module. + * @module model/TestInlineFreeformAdditionalPropertiesRequest + * @version 1.0.0 + */ +class TestInlineFreeformAdditionalPropertiesRequest { + /** + * Constructs a new TestInlineFreeformAdditionalPropertiesRequest. + * @alias module:model/TestInlineFreeformAdditionalPropertiesRequest + * @extends Object + */ + constructor() { + + TestInlineFreeformAdditionalPropertiesRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a TestInlineFreeformAdditionalPropertiesRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} obj Optional instance to populate. + * @return {module:model/TestInlineFreeformAdditionalPropertiesRequest} The populated TestInlineFreeformAdditionalPropertiesRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TestInlineFreeformAdditionalPropertiesRequest(); + + ApiClient.constructFromObject(data, obj, 'Object'); + + + if (data.hasOwnProperty('someProperty')) { + obj['someProperty'] = ApiClient.convertToType(data['someProperty'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to TestInlineFreeformAdditionalPropertiesRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to TestInlineFreeformAdditionalPropertiesRequest. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['someProperty'] && !(typeof data['someProperty'] === 'string' || data['someProperty'] instanceof String)) { + throw new Error("Expected the field `someProperty` to be a primitive type in the JSON string but got " + data['someProperty']); + } + + return true; + } + + +} + + + +/** + * @member {String} someProperty + */ +TestInlineFreeformAdditionalPropertiesRequest.prototype['someProperty'] = undefined; + + + + + + +export default TestInlineFreeformAdditionalPropertiesRequest; + diff --git a/samples/client/petstore/javascript-promise-es6/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js new file mode 100644 index 00000000000..7ce7731bf57 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/TestInlineFreeformAdditionalPropertiesRequest.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TestInlineFreeformAdditionalPropertiesRequest', function() { + it('should create an instance of TestInlineFreeformAdditionalPropertiesRequest', function() { + // uncomment below and update the code to test TestInlineFreeformAdditionalPropertiesRequest + //var instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + //expect(instance).to.be.a(OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest); + }); + + it('should have the property someProperty (base name: "someProperty")', function() { + // uncomment below and update the code to test the property someProperty + //var instance = new OpenApiPetstore.TestInlineFreeformAdditionalPropertiesRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 2805043984b..8ccd72bcf92 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -121,6 +121,22 @@ export default function() { } }); + group("/fake/inline-freeform-additionalProperties", () => { + + // Request No. 1: testInlineFreeformAdditionalProperties + { + let url = BASE_URL + `/fake/inline-freeform-additionalProperties`; + // TODO: edit the parameters of the request body. + let body = {"someProperty": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/user/{username}", () => { let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec diff --git a/samples/client/petstore/perl/.openapi-generator/FILES b/samples/client/petstore/perl/.openapi-generator/FILES index d6a142a834b..790e480f56d 100644 --- a/samples/client/petstore/perl/.openapi-generator/FILES +++ b/samples/client/petstore/perl/.openapi-generator/FILES @@ -56,6 +56,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -114,6 +115,7 @@ lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm lib/WWW/OpenAPIClient/Object/SingleRefType.pm lib/WWW/OpenAPIClient/Object/SpecialModelName.pm lib/WWW/OpenAPIClient/Object/Tag.pm +lib/WWW/OpenAPIClient/Object/TestInlineFreeformAdditionalPropertiesRequest.pm lib/WWW/OpenAPIClient/Object/User.pm lib/WWW/OpenAPIClient/PetApi.pm lib/WWW/OpenAPIClient/Role.pm diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index affa55c6194..6658f7e9469 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -290,6 +290,7 @@ use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SingleRefType; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; +use WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest; use WWW::OpenAPIClient::Object::User; ```` @@ -359,6 +360,7 @@ use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SingleRefType; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; +use WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest; use WWW::OpenAPIClient::Object::User; # for displaying the API response data @@ -404,6 +406,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**test_nullable**](docs/FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | @@ -480,6 +483,7 @@ Class | Method | HTTP request | Description - [WWW::OpenAPIClient::Object::SingleRefType](docs/SingleRefType.md) - [WWW::OpenAPIClient::Object::SpecialModelName](docs/SpecialModelName.md) - [WWW::OpenAPIClient::Object::Tag](docs/Tag.md) + - [WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [WWW::OpenAPIClient::Object::User](docs/User.md) diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 0bd3dce02b7..fb3661a71a4 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -25,6 +25,7 @@ Method | HTTP request | Description [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data [**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | @@ -813,6 +814,51 @@ 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) +# **test_inline_freeform_additional_properties** +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request => $test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Example +```perl +use Data::Dumper; +use WWW::OpenAPIClient::FakeApi; +my $api_instance = WWW::OpenAPIClient::FakeApi->new( +); + +my $test_inline_freeform_additional_properties_request = WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest->new(); # TestInlineFreeformAdditionalPropertiesRequest | request body + +eval { + $api_instance->test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request => $test_inline_freeform_additional_properties_request); +}; +if ($@) { + warn "Exception when calling FakeApi->test_inline_freeform_additional_properties: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + # **test_json_form_data** > test_json_form_data(param => $param, param2 => $param2) diff --git a/samples/client/petstore/perl/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/perl/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..cb83cdfb877 --- /dev/null +++ b/samples/client/petstore/perl/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index e1a34b97162..376b9fdd2c5 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -1344,6 +1344,67 @@ sub test_inline_additional_properties { return; } +# +# test_inline_freeform_additional_properties +# +# test inline free-form additionalProperties +# +# @param TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) +{ + my $params = { + 'test_inline_freeform_additional_properties_request' => { + data_type => 'TestInlineFreeformAdditionalPropertiesRequest', + description => 'request body', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ 'test_inline_freeform_additional_properties' } = { + summary => 'test inline free-form additionalProperties', + params => $params, + returns => undef, + }; +} +# @return void +# +sub test_inline_freeform_additional_properties { + my ($self, %args) = @_; + + # verify the required parameter 'test_inline_freeform_additional_properties_request' is set + unless (exists $args{'test_inline_freeform_additional_properties_request'}) { + croak("Missing the required parameter 'test_inline_freeform_additional_properties_request' when calling test_inline_freeform_additional_properties"); + } + + # parse inputs + my $_resource_path = '/fake/inline-freeform-additionalProperties'; + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); + + my $_body_data; + # body params + if ( exists $args{'test_inline_freeform_additional_properties_request'}) { + $_body_data = $args{'test_inline_freeform_additional_properties_request'}; + } + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; +} + # # test_json_form_data # diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TestInlineFreeformAdditionalPropertiesRequest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TestInlineFreeformAdditionalPropertiesRequest.pm new file mode 100644 index 00000000000..d412e6f6ed8 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TestInlineFreeformAdditionalPropertiesRequest.pm @@ -0,0 +1,243 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use WWW::OpenAPIClient::Object::AnyType; + +use base ("Class::Accessor", "Class::Data::Inheritable"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + my $_json_attribute = $self->attribute_map->{$_key}; + my $_type = $self->openapi_types->{$_key}; + my $_value = $self->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + $_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ]; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$_value}) { + $_hash{$_key} = $self->_to_json_primitives($_subclass, $_element); + } + $_data->{$_json_attribute} = \%_hash; + } elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) { + $_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value); + } else { + $_data->{$_json_attribute} = $_value; + } + } + } + + return $_data; +} + +# to_json non-array data +sub _to_json_primitives { + my ($self, $type, $data) = @_; + if ( grep( /^$type$/, ('int', 'double'))) { + # https://metacpan.org/pod/JSON#simple-scalars + # numify it, ensuring it will be dumped as a number + return undef unless defined $data; + return $data + 0; + } elsif ($type eq 'string') { + # https://metacpan.org/pod/JSON#simple-scalars + # stringified + return undef unless defined $data; + return $data . q(); + } elsif ($type eq 'boolean') { + # https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null + return $data ? \1 : \0; + } elsif ($type eq 'DATE') { + return undef unless defined $data; + if (ref($data) eq 'DateTime') { + # https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...) + return $data->ymd; + } + return $data .q(); + } elsif ($type eq 'DATE_TIME') { + return undef unless defined $data; + # the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z + if (ref($data) eq 'DateTime') { + # https://metacpan.org/pod/DateTime#$dt-%3Erfc3339 + return $data->rfc3339; + } + return $data .q(); + } else { # hash (model), In this case, the TO_JSON of the $data object is executed + return $data; + } +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double'))) { + return undef unless defined $data; + return $data + 0; + } elsif ($type eq 'string') { + return undef unless defined $data; + return $data . q(); + } elsif ($type eq 'boolean') { + return !!$data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + +__PACKAGE__->class_documentation({description => '', + class => 'TestInlineFreeformAdditionalPropertiesRequest', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'some_property' => { + datatype => 'string', + base_name => 'someProperty', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'some_property' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'some_property' => 'someProperty' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/t/TestInlineFreeformAdditionalPropertiesRequestTest.t b/samples/client/petstore/perl/t/TestInlineFreeformAdditionalPropertiesRequestTest.t new file mode 100644 index 00000000000..32d797e4c40 --- /dev/null +++ b/samples/client/petstore/perl/t/TestInlineFreeformAdditionalPropertiesRequestTest.t @@ -0,0 +1,34 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest'); + +# uncomment below and update the test +#my $instance = WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest->new(); +# +#isa_ok($instance, 'WWW::OpenAPIClient::Object::TestInlineFreeformAdditionalPropertiesRequest'); + diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES index b7160868e12..ec822fdd883 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/Model/ReadOnlyFirst.md docs/Model/SingleRefType.md docs/Model/SpecialModelName.md docs/Model/Tag.md +docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md docs/Model/User.md git_push.sh phpunit.xml.dist @@ -121,5 +122,6 @@ src/Model/ReadOnlyFirst.php src/Model/SingleRefType.php src/Model/SpecialModelName.php src/Model/Tag.php +src/Model/TestInlineFreeformAdditionalPropertiesRequest.php src/Model/User.php src/ObjectSerializer.php diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md b/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md index 201cf56d7fb..9fd66c9b427 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/Api/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](docs/Api/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -165,6 +166,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/Model/SingleRefType.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) +- [TestInlineFreeformAdditionalPropertiesRequest](docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/Model/User.md) ## Authorization diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Api/FakeApi.md index 67f8694a75f..72bea0168be 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Api/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati | [**testEnumParameters()**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters()**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties()**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties()**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData()**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testNullable()**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | | [**testQueryParameterCollectionFormat()**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -976,6 +977,61 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `testInlineFreeformAdditionalProperties()` + +```php +testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request) +``` + +test inline free-form additionalProperties + + + +### Example + +```php +testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testInlineFreeformAdditionalProperties: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **test_inline_freeform_additional_properties_request** | [**\OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest**](../Model/TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `testJsonFormData()` ```php diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..27dc920d841 --- /dev/null +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,9 @@ +# # TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php index dc4cc21b651..10770355e21 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php @@ -120,6 +120,9 @@ class FakeApi 'testInlineAdditionalProperties' => [ 'application/json', ], + 'testInlineFreeformAdditionalProperties' => [ + 'application/json', + ], 'testJsonFormData' => [ 'application/x-www-form-urlencoded', ], @@ -4565,6 +4568,234 @@ class FakeApi ); } + /** + * Operation testInlineFreeformAdditionalProperties + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + $this->testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request, $contentType); + } + + /** + * Operation testInlineFreeformAdditionalPropertiesWithHttpInfo + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + $request = $this->testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testInlineFreeformAdditionalPropertiesAsync + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testInlineFreeformAdditionalPropertiesAsync($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + return $this->testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo($test_inline_freeform_additional_properties_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + $returnType = ''; + $request = $this->testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testInlineFreeformAdditionalProperties' + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + + // verify the required parameter 'test_inline_freeform_additional_properties_request' is set + if ($test_inline_freeform_additional_properties_request === null || (is_array($test_inline_freeform_additional_properties_request) && count($test_inline_freeform_additional_properties_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $test_inline_freeform_additional_properties_request when calling testInlineFreeformAdditionalProperties' + ); + } + + + $resourcePath = '/fake/inline-freeform-additionalProperties'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($test_inline_freeform_additional_properties_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($test_inline_freeform_additional_properties_request)); + } else { + $httpBody = $test_inline_freeform_additional_properties_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation testJsonFormData * diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php new file mode 100644 index 00000000000..48c5588bbe6 --- /dev/null +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php @@ -0,0 +1,409 @@ + + */ +class TestInlineFreeformAdditionalPropertiesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'testInlineFreeformAdditionalProperties_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'some_property' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'some_property' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'some_property' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'some_property' => 'someProperty' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'some_property' => 'setSomeProperty' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'some_property' => 'getSomeProperty' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('some_property', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets some_property + * + * @return string|null + */ + public function getSomeProperty() + { + return $this->container['some_property']; + } + + /** + * Sets some_property + * + * @param string|null $some_property some_property + * + * @return self + */ + public function setSomeProperty($some_property) + { + if (is_null($some_property)) { + throw new \InvalidArgumentException('non-nullable some_property cannot be null'); + } + $this->container['some_property'] = $some_property; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/tests/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/tests/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php new file mode 100644 index 00000000000..90919a0a12b --- /dev/null +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/tests/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "some_property" + */ + public function testPropertySomeProperty() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES index 518ce4af190..80ecc7a7237 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -57,6 +57,7 @@ docs/Model/ReadOnlyFirst.md docs/Model/SingleRefType.md docs/Model/SpecialModelName.md docs/Model/Tag.md +docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md docs/Model/User.md git_push.sh lib/Api/AnotherFakeApi.php @@ -117,6 +118,7 @@ lib/Model/ReadOnlyFirst.php lib/Model/SingleRefType.php lib/Model/SpecialModelName.php lib/Model/Tag.php +lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php lib/Model/User.php lib/ObjectSerializer.php phpunit.xml.dist diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 381db66d7eb..8a10479d27a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -91,6 +91,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/Api/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -165,6 +166,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/Model/SingleRefType.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) +- [TestInlineFreeformAdditionalPropertiesRequest](docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/Model/User.md) ## Authorization 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 2155fb94726..2b5343f2b1b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati | [**testEnumParameters()**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters()**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties()**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties()**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData()**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat()**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -1037,6 +1038,61 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `testInlineFreeformAdditionalProperties()` + +```php +testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request) +``` + +test inline free-form additionalProperties + + + +### Example + +```php +testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testInlineFreeformAdditionalProperties: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **test_inline_freeform_additional_properties_request** | [**\OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest**](../Model/TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `testJsonFormData()` ```php diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..27dc920d841 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,9 @@ +# # TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) 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 8665f33c194..a1bb31cbe6f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -123,6 +123,9 @@ class FakeApi 'testInlineAdditionalProperties' => [ 'application/json', ], + 'testInlineFreeformAdditionalProperties' => [ + 'application/json', + ], 'testJsonFormData' => [ 'application/x-www-form-urlencoded', ], @@ -4864,6 +4867,234 @@ class FakeApi ); } + /** + * Operation testInlineFreeformAdditionalProperties + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + $this->testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request, $contentType); + } + + /** + * Operation testInlineFreeformAdditionalPropertiesWithHttpInfo + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + $request = $this->testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testInlineFreeformAdditionalPropertiesAsync + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testInlineFreeformAdditionalPropertiesAsync($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + return $this->testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo($test_inline_freeform_additional_properties_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + $returnType = ''; + $request = $this->testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testInlineFreeformAdditionalProperties' + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineFreeformAdditionalProperties'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request, string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]) + { + + // verify the required parameter 'test_inline_freeform_additional_properties_request' is set + if ($test_inline_freeform_additional_properties_request === null || (is_array($test_inline_freeform_additional_properties_request) && count($test_inline_freeform_additional_properties_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $test_inline_freeform_additional_properties_request when calling testInlineFreeformAdditionalProperties' + ); + } + + + $resourcePath = '/fake/inline-freeform-additionalProperties'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($test_inline_freeform_additional_properties_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($test_inline_freeform_additional_properties_request)); + } else { + $httpBody = $test_inline_freeform_additional_properties_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation testJsonFormData * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php new file mode 100644 index 00000000000..e2cd3f6295c --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php @@ -0,0 +1,409 @@ + + */ +class TestInlineFreeformAdditionalPropertiesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'testInlineFreeformAdditionalProperties_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'some_property' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'some_property' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'some_property' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'some_property' => 'someProperty' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'some_property' => 'setSomeProperty' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'some_property' => 'getSomeProperty' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('some_property', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets some_property + * + * @return string|null + */ + public function getSomeProperty() + { + return $this->container['some_property']; + } + + /** + * Sets some_property + * + * @param string|null $some_property some_property + * + * @return self + */ + public function setSomeProperty($some_property) + { + if (is_null($some_property)) { + throw new \InvalidArgumentException('non-nullable some_property cannot be null'); + } + $this->container['some_property'] = $some_property; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php new file mode 100644 index 00000000000..ce35b026ba9 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "some_property" + */ + public function testPropertySomeProperty() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/samples/client/petstore/php/psr-18/.openapi-generator/FILES b/samples/client/petstore/php/psr-18/.openapi-generator/FILES index b702a79bd39..34aee01b39f 100644 --- a/samples/client/petstore/php/psr-18/.openapi-generator/FILES +++ b/samples/client/petstore/php/psr-18/.openapi-generator/FILES @@ -57,6 +57,7 @@ docs/Model/ReadOnlyFirst.md docs/Model/SingleRefType.md docs/Model/SpecialModelName.md docs/Model/Tag.md +docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md docs/Model/User.md git_push.sh lib/Api/AnotherFakeApi.php @@ -118,6 +119,7 @@ lib/Model/ReadOnlyFirst.php lib/Model/SingleRefType.php lib/Model/SpecialModelName.php lib/Model/Tag.php +lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php lib/Model/User.php lib/ObjectSerializer.php phpunit.xml.dist diff --git a/samples/client/petstore/php/psr-18/README.md b/samples/client/petstore/php/psr-18/README.md index 38a52823b87..f2d87528621 100644 --- a/samples/client/petstore/php/psr-18/README.md +++ b/samples/client/petstore/php/psr-18/README.md @@ -102,6 +102,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/Api/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -176,6 +177,7 @@ Class | Method | HTTP request | Description - [SingleRefType](docs/Model/SingleRefType.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) +- [TestInlineFreeformAdditionalPropertiesRequest](docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/Model/User.md) ## Authorization diff --git a/samples/client/petstore/php/psr-18/docs/Api/FakeApi.md b/samples/client/petstore/php/psr-18/docs/Api/FakeApi.md index 8ab1bf86ab3..e7b93904d5b 100644 --- a/samples/client/petstore/php/psr-18/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/psr-18/docs/Api/FakeApi.md @@ -21,6 +21,7 @@ Method | HTTP request | Description [**testEnumParameters()**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters()**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties()**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties()**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData()**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data [**testQueryParameterCollectionFormat()**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -1034,6 +1035,61 @@ No authorization required [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `testInlineFreeformAdditionalProperties()` + +```php +testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request) +``` + +test inline free-form additionalProperties + + + +### Example + +```php +testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testInlineFreeformAdditionalProperties: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_inline_freeform_additional_properties_request** | [**\OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest**](../Model/TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `testJsonFormData()` ```php diff --git a/samples/client/petstore/php/psr-18/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/php/psr-18/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..27dc920d841 --- /dev/null +++ b/samples/client/petstore/php/psr-18/docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,9 @@ +# # TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php index 0d559c958a0..1dd75bd13c1 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php @@ -4525,6 +4525,218 @@ class FakeApi return $this->createRequest('POST', $uri, $headers, $httpBody); } + /** + * Operation testInlineFreeformAdditionalProperties + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testInlineFreeformAdditionalProperties($test_inline_freeform_additional_properties_request) + { + $this->testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request); + } + + /** + * Operation testInlineFreeformAdditionalPropertiesWithHttpInfo + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request) + { + $request = $this->testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request); + + try { + try { + $response = $this->httpClient->sendRequest($request); + } catch (HttpException $e) { + $response = $e->getResponse(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $response->getStatusCode(), + (string) $request->getUri() + ), + $request, + $response, + $e + ); + } catch (ClientExceptionInterface $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $request, + null, + $e + ); + } + + $statusCode = $response->getStatusCode(); + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testInlineFreeformAdditionalPropertiesAsync + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * + * @throws \InvalidArgumentException + * @return Promise + */ + public function testInlineFreeformAdditionalPropertiesAsync($test_inline_freeform_additional_properties_request) + { + return $this->testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo($test_inline_freeform_additional_properties_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo + * + * test inline free-form additionalProperties + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * + * @throws \InvalidArgumentException + * @return Promise + */ + public function testInlineFreeformAdditionalPropertiesAsyncWithHttpInfo($test_inline_freeform_additional_properties_request) + { + $returnType = ''; + $request = $this->testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request); + + return $this->httpAsyncClient->sendAsyncRequest($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function (HttpException $exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $exception->getRequest(), + $exception->getResponse(), + $exception + ); + } + ); + } + + /** + * Create request for operation 'testInlineFreeformAdditionalProperties' + * + * @param \OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request request body (required) + * + * @throws \InvalidArgumentException + * @return RequestInterface + */ + public function testInlineFreeformAdditionalPropertiesRequest($test_inline_freeform_additional_properties_request) + { + // verify the required parameter 'test_inline_freeform_additional_properties_request' is set + if ($test_inline_freeform_additional_properties_request === null || (is_array($test_inline_freeform_additional_properties_request) && count($test_inline_freeform_additional_properties_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $test_inline_freeform_additional_properties_request when calling testInlineFreeformAdditionalProperties' + ); + } + + $resourcePath = '/fake/inline-freeform-additionalProperties'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = null; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($test_inline_freeform_additional_properties_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($test_inline_freeform_additional_properties_request)); + } else { + $httpBody = $test_inline_freeform_additional_properties_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + + $uri = $this->createUri($operationHost, $resourcePath, $queryParams); + + return $this->createRequest('POST', $uri, $headers, $httpBody); + } + /** * Operation testJsonFormData * diff --git a/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php b/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php new file mode 100644 index 00000000000..e2cd3f6295c --- /dev/null +++ b/samples/client/petstore/php/psr-18/lib/Model/TestInlineFreeformAdditionalPropertiesRequest.php @@ -0,0 +1,409 @@ + + */ +class TestInlineFreeformAdditionalPropertiesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'testInlineFreeformAdditionalProperties_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'some_property' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'some_property' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'some_property' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'some_property' => 'someProperty' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'some_property' => 'setSomeProperty' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'some_property' => 'getSomeProperty' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('some_property', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets some_property + * + * @return string|null + */ + public function getSomeProperty() + { + return $this->container['some_property']; + } + + /** + * Sets some_property + * + * @param string|null $some_property some_property + * + * @return self + */ + public function setSomeProperty($some_property) + { + if (is_null($some_property)) { + throw new \InvalidArgumentException('non-nullable some_property cannot be null'); + } + $this->container['some_property'] = $some_property; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/psr-18/test/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php b/samples/client/petstore/php/psr-18/test/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php new file mode 100644 index 00000000000..ce35b026ba9 --- /dev/null +++ b/samples/client/petstore/php/psr-18/test/Model/TestInlineFreeformAdditionalPropertiesRequestTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "some_property" + */ + public function testPropertySomeProperty() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/samples/client/petstore/powershell/.openapi-generator/FILES b/samples/client/petstore/powershell/.openapi-generator/FILES index 7e8383cf879..68bd824f6d7 100644 --- a/samples/client/petstore/powershell/.openapi-generator/FILES +++ b/samples/client/petstore/powershell/.openapi-generator/FILES @@ -76,6 +76,7 @@ docs/ShapeOrNull.md docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -157,6 +158,7 @@ src/PSPetstore/Model/ShapeOrNull.ps1 src/PSPetstore/Model/SimpleQuadrilateral.ps1 src/PSPetstore/Model/SpecialModelName.ps1 src/PSPetstore/Model/Tag.ps1 +src/PSPetstore/Model/TestInlineFreeformAdditionalPropertiesRequest.ps1 src/PSPetstore/Model/Triangle.ps1 src/PSPetstore/Model/TriangleInterface.ps1 src/PSPetstore/Model/User.ps1 diff --git a/samples/client/petstore/powershell/README.md b/samples/client/petstore/powershell/README.md index 30b0f1454ee..57c663aae01 100644 --- a/samples/client/petstore/powershell/README.md +++ b/samples/client/petstore/powershell/README.md @@ -70,6 +70,7 @@ Class | Method | HTTP request | Description *PSFakeApi* | [**Test-PSEnumParameters**](docs/PSFakeApi.md#Test-PSEnumParameters) | **GET** /fake | To test enum parameters *PSFakeApi* | [**Test-PSGroupParameters**](docs/PSFakeApi.md#Test-PSGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *PSFakeApi* | [**Test-PSInlineAdditionalProperties**](docs/PSFakeApi.md#Test-PSInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*PSFakeApi* | [**Test-PSInlineFreeformAdditionalProperties**](docs/PSFakeApi.md#Test-PSInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *PSFakeApi* | [**Test-PSJsonFormData**](docs/PSFakeApi.md#Test-PSJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *PSFakeApi* | [**Test-PSQueryParameterCollectionFormat**](docs/PSFakeApi.md#Test-PSQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *PSFakeClassnameTags123Api* | [**Test-PSClassname**](docs/PSFakeClassnameTags123Api.md#Test-PSClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -166,6 +167,7 @@ Class | Method | HTTP request | Description - [PSPetstore\Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [PSPetstore\Model.SpecialModelName](docs/SpecialModelName.md) - [PSPetstore\Model.Tag](docs/Tag.md) + - [PSPetstore\Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [PSPetstore\Model.Triangle](docs/Triangle.md) - [PSPetstore\Model.TriangleInterface](docs/TriangleInterface.md) - [PSPetstore\Model.User](docs/User.md) diff --git a/samples/client/petstore/powershell/docs/PSFakeApi.md b/samples/client/petstore/powershell/docs/PSFakeApi.md index c11eab30f44..cfa337e3447 100644 --- a/samples/client/petstore/powershell/docs/PSFakeApi.md +++ b/samples/client/petstore/powershell/docs/PSFakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**Test-PSEnumParameters**](PSFakeApi.md#Test-PSEnumParameters) | **GET** /fake | To test enum parameters [**Test-PSGroupParameters**](PSFakeApi.md#Test-PSGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**Test-PSInlineAdditionalProperties**](PSFakeApi.md#Test-PSInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**Test-PSInlineFreeformAdditionalProperties**](PSFakeApi.md#Test-PSInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**Test-PSJsonFormData**](PSFakeApi.md#Test-PSJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data [**Test-PSQueryParameterCollectionFormat**](PSFakeApi.md#Test-PSQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | @@ -646,6 +647,49 @@ 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) + +# **Test-PSInlineFreeformAdditionalProperties** +> void Test-PSInlineFreeformAdditionalProperties
+>         [-TestInlineFreeformAdditionalPropertiesRequest]
+ +test inline free-form additionalProperties + + + +### Example +```powershell +$TestInlineFreeformAdditionalPropertiesRequest = Initialize-TestInlineFreeformAdditionalPropertiesRequest -SomeProperty "MySomeProperty" # TestInlineFreeformAdditionalPropertiesRequest | request body + +# test inline free-form additionalProperties +try { + $Result = Test-PSInlineFreeformAdditionalProperties -TestInlineFreeformAdditionalPropertiesRequest $TestInlineFreeformAdditionalPropertiesRequest +} catch { + Write-Host ("Exception occurred when calling Test-PSInlineFreeformAdditionalProperties: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **TestInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + # **Test-PSJsonFormData** > void Test-PSJsonFormData
diff --git a/samples/client/petstore/powershell/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/powershell/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..09ee61db568 --- /dev/null +++ b/samples/client/petstore/powershell/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,21 @@ +# TestInlineFreeformAdditionalPropertiesRequest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$TestInlineFreeformAdditionalPropertiesRequest = Initialize-PSPetstoreTestInlineFreeformAdditionalPropertiesRequest -SomeProperty null +``` + +- Convert the resource to JSON +```powershell +$TestInlineFreeformAdditionalPropertiesRequest | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 index 7d2c4596574..33edac7ec1b 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 @@ -1237,6 +1237,81 @@ function Test-PSInlineAdditionalProperties { <# .SYNOPSIS +test inline free-form additionalProperties + +.DESCRIPTION + +No description available. + +.PARAMETER TestInlineFreeformAdditionalPropertiesRequest +request body + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSInlineFreeformAdditionalProperties { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${TestInlineFreeformAdditionalPropertiesRequest}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSInlineFreeformAdditionalProperties' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/inline-freeform-additionalProperties' + + if (!$TestInlineFreeformAdditionalPropertiesRequest) { + throw "Error! The required parameter `TestInlineFreeformAdditionalPropertiesRequest` missing when calling testInlineFreeformAdditionalProperties." + } + + $LocalVarBodyParameter = $TestInlineFreeformAdditionalPropertiesRequest | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + test json serialization of form data .DESCRIPTION diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/TestInlineFreeformAdditionalPropertiesRequest.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/TestInlineFreeformAdditionalPropertiesRequest.ps1 new file mode 100644 index 00000000000..a7b88520157 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/TestInlineFreeformAdditionalPropertiesRequest.ps1 @@ -0,0 +1,100 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER SomeProperty +No description available. +.OUTPUTS + +TestInlineFreeformAdditionalPropertiesRequest +#> + +function Initialize-PSTestInlineFreeformAdditionalPropertiesRequest { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${SomeProperty} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSTestInlineFreeformAdditionalPropertiesRequest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "someProperty" = ${SomeProperty} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to TestInlineFreeformAdditionalPropertiesRequest + +.DESCRIPTION + +Convert from JSON to TestInlineFreeformAdditionalPropertiesRequest + +.PARAMETER Json + +Json object + +.OUTPUTS + +TestInlineFreeformAdditionalPropertiesRequest +#> +function ConvertFrom-PSJsonToTestInlineFreeformAdditionalPropertiesRequest { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSTestInlineFreeformAdditionalPropertiesRequest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + $PSTestInlineFreeformAdditionalPropertiesRequestAdditionalProperties = @{} + + # check if Json contains properties not defined in PSTestInlineFreeformAdditionalPropertiesRequest + $AllProperties = ("someProperty") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + # store undefined properties in additionalProperties + if (!($AllProperties.Contains($name))) { + $PSTestInlineFreeformAdditionalPropertiesRequestAdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "someProperty"))) { #optional property not found + $SomeProperty = $null + } else { + $SomeProperty = $JsonParameters.PSobject.Properties["someProperty"].value + } + + $PSO = [PSCustomObject]@{ + "someProperty" = ${SomeProperty} + "AdditionalProperties" = $PSTestInlineFreeformAdditionalPropertiesRequestAdditionalProperties + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/tests/Model/TestInlineFreeformAdditionalPropertiesRequest.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/TestInlineFreeformAdditionalPropertiesRequest.Tests.ps1 new file mode 100644 index 00000000000..599b1443a4e --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/TestInlineFreeformAdditionalPropertiesRequest.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSTestInlineFreeformAdditionalPropertiesRequest' { + Context 'PSTestInlineFreeformAdditionalPropertiesRequest' { + It 'Initialize-PSTestInlineFreeformAdditionalPropertiesRequest' { + # a simple test to create an object + #$NewObject = Initialize-PSTestInlineFreeformAdditionalPropertiesRequest -SomeProperty "TEST_VALUE" + #$NewObject | Should -BeOfType TestInlineFreeformAdditionalPropertiesRequest + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/ruby-autoload/.openapi-generator/FILES b/samples/client/petstore/ruby-autoload/.openapi-generator/FILES index f005dcee552..fc02f30778d 100644 --- a/samples/client/petstore/ruby-autoload/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-autoload/.openapi-generator/FILES @@ -60,6 +60,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -122,6 +123,7 @@ lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb +lib/petstore/models/test_inline_freeform_additional_properties_request.rb lib/petstore/models/user.rb lib/petstore/version.rb petstore.gemspec diff --git a/samples/client/petstore/ruby-autoload/README.md b/samples/client/petstore/ruby-autoload/README.md index ee269a91bf6..2eec0459c1e 100644 --- a/samples/client/petstore/ruby-autoload/README.md +++ b/samples/client/petstore/ruby-autoload/README.md @@ -93,6 +93,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*Petstore::FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *Petstore::FakeApi* | [**test_nullable**](docs/FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property *Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | @@ -170,6 +171,7 @@ Class | Method | HTTP request | Description - [Petstore::SingleRefType](docs/SingleRefType.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) + - [Petstore::TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby-autoload/docs/FakeApi.md b/samples/client/petstore/ruby-autoload/docs/FakeApi.md index 3980b6c60d2..f43e4402cf1 100644 --- a/samples/client/petstore/ruby-autoload/docs/FakeApi.md +++ b/samples/client/petstore/ruby-autoload/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters | | [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data | | [**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property | | [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | | @@ -1117,6 +1118,69 @@ No authorization required - **Accept**: Not defined +## test_inline_freeform_additional_properties + +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +test_inline_freeform_additional_properties_request = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new # TestInlineFreeformAdditionalPropertiesRequest | request body + +begin + # test inline free-form additionalProperties + api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_inline_freeform_additional_properties: #{e}" +end +``` + +#### Using the test_inline_freeform_additional_properties_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request) + +```ruby +begin + # test inline free-form additionalProperties + data, status_code, headers = api_instance.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_inline_freeform_additional_properties_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + ## test_json_form_data > test_json_form_data(param, param2) diff --git a/samples/client/petstore/ruby-autoload/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/ruby-autoload/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c976800c181 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,18 @@ +# Petstore::TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **some_property** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new( + some_property: null +) +``` + diff --git a/samples/client/petstore/ruby-autoload/lib/petstore.rb b/samples/client/petstore/ruby-autoload/lib/petstore.rb index 72b626acd2e..cac10c9f042 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore.rb @@ -65,6 +65,7 @@ Petstore.autoload :ReadOnlyFirst, 'petstore/models/read_only_first' Petstore.autoload :SingleRefType, 'petstore/models/single_ref_type' Petstore.autoload :SpecialModelName, 'petstore/models/special_model_name' Petstore.autoload :Tag, 'petstore/models/tag' +Petstore.autoload :TestInlineFreeformAdditionalPropertiesRequest, 'petstore/models/test_inline_freeform_additional_properties_request' Petstore.autoload :User, 'petstore/models/user' # APIs diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb index 3e90201ee0f..e3235d6990d 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb @@ -1220,6 +1220,72 @@ module Petstore return data, status_code, headers end + # test inline free-form additionalProperties + # + # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request, opts = {}) + test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts) + nil + end + + # test inline free-form additionalProperties + # + # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_freeform_additional_properties ...' + end + # verify the required parameter 'test_inline_freeform_additional_properties_request' is set + if @api_client.config.client_side_validation && test_inline_freeform_additional_properties_request.nil? + fail ArgumentError, "Missing the required parameter 'test_inline_freeform_additional_properties_request' when calling FakeApi.test_inline_freeform_additional_properties" + end + # resource path + local_var_path = '/fake/inline-freeform-additionalProperties' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(test_inline_freeform_additional_properties_request) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_inline_freeform_additional_properties", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_inline_freeform_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # test json serialization of form data # # @param param [String] field1 diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/models/test_inline_freeform_additional_properties_request.rb b/samples/client/petstore/ruby-autoload/lib/petstore/models/test_inline_freeform_additional_properties_request.rb new file mode 100644 index 00000000000..bf7c0b98a13 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/lib/petstore/models/test_inline_freeform_additional_properties_request.rb @@ -0,0 +1,214 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.1.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class TestInlineFreeformAdditionalPropertiesRequest + attr_accessor :some_property + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'some_property' => :'someProperty' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'some_property' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TestInlineFreeformAdditionalPropertiesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TestInlineFreeformAdditionalPropertiesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'some_property') + self.some_property = attributes[:'some_property'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + some_property == o.some_property + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [some_property].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby-autoload/spec/models/test_inline_freeform_additional_properties_request_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/test_inline_freeform_additional_properties_request_spec.rb new file mode 100644 index 00000000000..2508babe727 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/spec/models/test_inline_freeform_additional_properties_request_spec.rb @@ -0,0 +1,34 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::TestInlineFreeformAdditionalPropertiesRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::TestInlineFreeformAdditionalPropertiesRequest do + let(:instance) { Petstore::TestInlineFreeformAdditionalPropertiesRequest.new } + + describe 'test an instance of TestInlineFreeformAdditionalPropertiesRequest' do + it 'should create an instance of TestInlineFreeformAdditionalPropertiesRequest' do + expect(instance).to be_instance_of(Petstore::TestInlineFreeformAdditionalPropertiesRequest) + end + end + describe 'test attribute "some_property"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index f005dcee552..fc02f30778d 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -60,6 +60,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md git_push.sh @@ -122,6 +123,7 @@ lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb +lib/petstore/models/test_inline_freeform_additional_properties_request.rb lib/petstore/models/user.rb lib/petstore/version.rb petstore.gemspec diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index ee269a91bf6..2eec0459c1e 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -93,6 +93,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*Petstore::FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *Petstore::FakeApi* | [**test_nullable**](docs/FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property *Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | @@ -170,6 +171,7 @@ Class | Method | HTTP request | Description - [Petstore::SingleRefType](docs/SingleRefType.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) + - [Petstore::TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 3980b6c60d2..f43e4402cf1 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -20,6 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters | | [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data | | [**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property | | [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | | @@ -1117,6 +1118,69 @@ No authorization required - **Accept**: Not defined +## test_inline_freeform_additional_properties + +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +test_inline_freeform_additional_properties_request = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new # TestInlineFreeformAdditionalPropertiesRequest | request body + +begin + # test inline free-form additionalProperties + api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_inline_freeform_additional_properties: #{e}" +end +``` + +#### Using the test_inline_freeform_additional_properties_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request) + +```ruby +begin + # test inline free-form additionalProperties + data, status_code, headers = api_instance.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_inline_freeform_additional_properties_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + ## test_json_form_data > test_json_form_data(param, param2) diff --git a/samples/client/petstore/ruby-faraday/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/ruby-faraday/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c976800c181 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,18 @@ +# Petstore::TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **some_property** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new( + some_property: null +) +``` + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 9902da58b06..1eb267a633d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -62,6 +62,7 @@ require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' require 'petstore/models/special_model_name' require 'petstore/models/tag' +require 'petstore/models/test_inline_freeform_additional_properties_request' require 'petstore/models/user' require 'petstore/models/cat' require 'petstore/models/child_with_nullable' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 3e90201ee0f..e3235d6990d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -1220,6 +1220,72 @@ module Petstore return data, status_code, headers end + # test inline free-form additionalProperties + # + # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request, opts = {}) + test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts) + nil + end + + # test inline free-form additionalProperties + # + # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_freeform_additional_properties ...' + end + # verify the required parameter 'test_inline_freeform_additional_properties_request' is set + if @api_client.config.client_side_validation && test_inline_freeform_additional_properties_request.nil? + fail ArgumentError, "Missing the required parameter 'test_inline_freeform_additional_properties_request' when calling FakeApi.test_inline_freeform_additional_properties" + end + # resource path + local_var_path = '/fake/inline-freeform-additionalProperties' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(test_inline_freeform_additional_properties_request) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_inline_freeform_additional_properties", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_inline_freeform_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # test json serialization of form data # # @param param [String] field1 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/test_inline_freeform_additional_properties_request.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/test_inline_freeform_additional_properties_request.rb new file mode 100644 index 00000000000..bf7c0b98a13 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/test_inline_freeform_additional_properties_request.rb @@ -0,0 +1,214 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.1.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class TestInlineFreeformAdditionalPropertiesRequest + attr_accessor :some_property + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'some_property' => :'someProperty' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'some_property' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TestInlineFreeformAdditionalPropertiesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TestInlineFreeformAdditionalPropertiesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'some_property') + self.some_property = attributes[:'some_property'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + some_property == o.some_property + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [some_property].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/test_inline_freeform_additional_properties_request_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/test_inline_freeform_additional_properties_request_spec.rb new file mode 100644 index 00000000000..2508babe727 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/test_inline_freeform_additional_properties_request_spec.rb @@ -0,0 +1,34 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::TestInlineFreeformAdditionalPropertiesRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::TestInlineFreeformAdditionalPropertiesRequest do + let(:instance) { Petstore::TestInlineFreeformAdditionalPropertiesRequest.new } + + describe 'test an instance of TestInlineFreeformAdditionalPropertiesRequest' do + it 'should create an instance of TestInlineFreeformAdditionalPropertiesRequest' do + expect(instance).to be_instance_of(Petstore::TestInlineFreeformAdditionalPropertiesRequest) + end + end + describe 'test attribute "some_property"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index b4903a62e7f..aa241d0edb5 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -62,6 +62,7 @@ docs/SingleRefType.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md docs/Whale.md @@ -128,6 +129,7 @@ lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb +lib/petstore/models/test_inline_freeform_additional_properties_request.rb lib/petstore/models/user.rb lib/petstore/models/whale.rb lib/petstore/models/zebra.rb diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 5f503a9304e..219e3ef720f 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -94,6 +94,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*Petstore::FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -172,6 +173,7 @@ Class | Method | HTTP request | Description - [Petstore::SingleRefType](docs/SingleRefType.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) + - [Petstore::TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Petstore::User](docs/User.md) - [Petstore::Whale](docs/Whale.md) - [Petstore::Zebra](docs/Zebra.md) diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index f5a40df0090..5785290cf7b 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters | | [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data | | [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | | @@ -1184,6 +1185,69 @@ No authorization required - **Accept**: Not defined +## test_inline_freeform_additional_properties + +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +test_inline_freeform_additional_properties_request = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new # TestInlineFreeformAdditionalPropertiesRequest | request body + +begin + # test inline free-form additionalProperties + api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_inline_freeform_additional_properties: #{e}" +end +``` + +#### Using the test_inline_freeform_additional_properties_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request) + +```ruby +begin + # test inline free-form additionalProperties + data, status_code, headers = api_instance.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_inline_freeform_additional_properties_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + ## test_json_form_data > test_json_form_data(param, param2) diff --git a/samples/client/petstore/ruby/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/ruby/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..c976800c181 --- /dev/null +++ b/samples/client/petstore/ruby/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,18 @@ +# Petstore::TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **some_property** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new( + some_property: null +) +``` + diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 084f5d08a02..058c4a4fffa 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -65,6 +65,7 @@ require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' require 'petstore/models/special_model_name' require 'petstore/models/tag' +require 'petstore/models/test_inline_freeform_additional_properties_request' require 'petstore/models/user' require 'petstore/models/whale' require 'petstore/models/zebra' 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 aa0f38d3317..85fe5da990b 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1301,6 +1301,72 @@ module Petstore return data, status_code, headers end + # test inline free-form additionalProperties + # + # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request, opts = {}) + test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts) + nil + end + + # test inline free-form additionalProperties + # + # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_freeform_additional_properties ...' + end + # verify the required parameter 'test_inline_freeform_additional_properties_request' is set + if @api_client.config.client_side_validation && test_inline_freeform_additional_properties_request.nil? + fail ArgumentError, "Missing the required parameter 'test_inline_freeform_additional_properties_request' when calling FakeApi.test_inline_freeform_additional_properties" + end + # resource path + local_var_path = '/fake/inline-freeform-additionalProperties' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(test_inline_freeform_additional_properties_request) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_inline_freeform_additional_properties", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_inline_freeform_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # test json serialization of form data # # @param param [String] field1 diff --git a/samples/client/petstore/ruby/lib/petstore/models/test_inline_freeform_additional_properties_request.rb b/samples/client/petstore/ruby/lib/petstore/models/test_inline_freeform_additional_properties_request.rb new file mode 100644 index 00000000000..bf7c0b98a13 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/test_inline_freeform_additional_properties_request.rb @@ -0,0 +1,214 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.1.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class TestInlineFreeformAdditionalPropertiesRequest + attr_accessor :some_property + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'some_property' => :'someProperty' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'some_property' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TestInlineFreeformAdditionalPropertiesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TestInlineFreeformAdditionalPropertiesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'some_property') + self.some_property = attributes[:'some_property'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + some_property == o.some_property + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [some_property].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/spec/models/test_inline_freeform_additional_properties_request_spec.rb b/samples/client/petstore/ruby/spec/models/test_inline_freeform_additional_properties_request_spec.rb new file mode 100644 index 00000000000..2508babe727 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/test_inline_freeform_additional_properties_request_spec.rb @@ -0,0 +1,34 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.0.1-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::TestInlineFreeformAdditionalPropertiesRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::TestInlineFreeformAdditionalPropertiesRequest do + let(:instance) { Petstore::TestInlineFreeformAdditionalPropertiesRequest.new } + + describe 'test an instance of TestInlineFreeformAdditionalPropertiesRequest' do + it 'should create an instance of TestInlineFreeformAdditionalPropertiesRequest' do + expect(instance).to be_instance_of(Petstore::TestInlineFreeformAdditionalPropertiesRequest) + end + end + describe 'test attribute "some_property"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts index 9a75bfa1ab1..1b920b9b539 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts @@ -1527,6 +1527,21 @@ export interface Tag { */ 'name'?: string; } +/** + * + * @export + * @interface TestInlineFreeformAdditionalPropertiesRequest + */ +export interface TestInlineFreeformAdditionalPropertiesRequest { + [key: string]: any; + + /** + * + * @type {string} + * @memberof TestInlineFreeformAdditionalPropertiesRequest + */ + 'someProperty'?: string; +} /** * @type Triangle * @export @@ -2496,6 +2511,42 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testInlineFreeformAdditionalProperties: async (testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'testInlineFreeformAdditionalPropertiesRequest' is not null or undefined + assertParamExists('testInlineFreeformAdditionalProperties', 'testInlineFreeformAdditionalPropertiesRequest', testInlineFreeformAdditionalPropertiesRequest) + const localVarPath = `/fake/inline-freeform-additionalProperties`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(testInlineFreeformAdditionalPropertiesRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary test json serialization of form data @@ -2779,6 +2830,17 @@ export const FakeApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.testInlineAdditionalProperties(requestBody, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary test json serialization of form data @@ -2963,6 +3025,16 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { return localVarFp.testInlineAdditionalProperties(requestBody, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: any): AxiosPromise { + return localVarFp.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options).then((request) => request(axios, basePath)); + }, /** * * @summary test json serialization of form data @@ -3171,6 +3243,18 @@ export class FakeApi extends BaseAPI { return FakeApiFp(this.configuration).testInlineAdditionalProperties(requestBody, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FakeApi + */ + public testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: AxiosRequestConfig) { + return FakeApiFp(this.configuration).testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary test json serialization of form data diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts index e4d6dc1e4db..640656edab2 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts @@ -1202,6 +1202,21 @@ export interface Tag { */ 'name'?: string; } +/** + * + * @export + * @interface TestInlineFreeformAdditionalPropertiesRequest + */ +export interface TestInlineFreeformAdditionalPropertiesRequest { + [key: string]: any; + + /** + * + * @type {string} + * @memberof TestInlineFreeformAdditionalPropertiesRequest + */ + 'someProperty'?: string; +} /** * * @export @@ -2120,6 +2135,42 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testInlineFreeformAdditionalProperties: async (testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'testInlineFreeformAdditionalPropertiesRequest' is not null or undefined + assertParamExists('testInlineFreeformAdditionalProperties', 'testInlineFreeformAdditionalPropertiesRequest', testInlineFreeformAdditionalPropertiesRequest) + const localVarPath = `/fake/inline-freeform-additionalProperties`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(testInlineFreeformAdditionalPropertiesRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary test json serialization of form data @@ -2437,6 +2488,17 @@ export const FakeApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.testInlineAdditionalProperties(requestBody, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary test json serialization of form data @@ -2623,6 +2685,16 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { return localVarFp.testInlineAdditionalProperties(requestBody, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: any): AxiosPromise { + return localVarFp.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options).then((request) => request(axios, basePath)); + }, /** * * @summary test json serialization of form data @@ -2830,6 +2902,18 @@ export class FakeApi extends BaseAPI { return FakeApiFp(this.configuration).testInlineAdditionalProperties(requestBody, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary test inline free-form additionalProperties + * @param {TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FakeApi + */ + public testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: AxiosRequestConfig) { + return FakeApiFp(this.configuration).testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary test json serialization of form data diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES index ac49dcd75a0..6baaabbfd16 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES @@ -55,6 +55,7 @@ models/Return.ts models/SingleRefType.ts models/SpecialModelName.ts models/Tag.ts +models/TestInlineFreeformAdditionalPropertiesRequest.ts models/User.ts models/index.ts runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index 06eb695d3fa..68ae3752e33 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -24,6 +24,7 @@ import type { OuterComposite, OuterObjectWithEnumProperty, Pet, + TestInlineFreeformAdditionalPropertiesRequest, User, } from '../models/index'; import { @@ -45,6 +46,8 @@ import { OuterObjectWithEnumPropertyToJSON, PetFromJSON, PetToJSON, + TestInlineFreeformAdditionalPropertiesRequestFromJSON, + TestInlineFreeformAdditionalPropertiesRequestToJSON, UserFromJSON, UserToJSON, } from '../models/index'; @@ -134,6 +137,10 @@ export interface TestInlineAdditionalPropertiesRequest { requestBody: { [key: string]: string; }; } +export interface TestInlineFreeformAdditionalPropertiesOperationRequest { + testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest; +} + export interface TestJsonFormDataRequest { param: string; param2: string; @@ -850,6 +857,40 @@ export class FakeApi extends runtime.BaseAPI { await this.testInlineAdditionalPropertiesRaw(requestParameters, initOverrides); } + /** + * + * test inline free-form additionalProperties + */ + async testInlineFreeformAdditionalPropertiesRaw(requestParameters: TestInlineFreeformAdditionalPropertiesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.testInlineFreeformAdditionalPropertiesRequest === null || requestParameters.testInlineFreeformAdditionalPropertiesRequest === undefined) { + throw new runtime.RequiredError('testInlineFreeformAdditionalPropertiesRequest','Required parameter requestParameters.testInlineFreeformAdditionalPropertiesRequest was null or undefined when calling testInlineFreeformAdditionalProperties.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/fake/inline-freeform-additionalProperties`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TestInlineFreeformAdditionalPropertiesRequestToJSON(requestParameters.testInlineFreeformAdditionalPropertiesRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test inline free-form additionalProperties + */ + async testInlineFreeformAdditionalProperties(requestParameters: TestInlineFreeformAdditionalPropertiesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testInlineFreeformAdditionalPropertiesRaw(requestParameters, initOverrides); + } + /** * * test json serialization of form data diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts new file mode 100644 index 00000000000..d8af84017df --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TestInlineFreeformAdditionalPropertiesRequest + */ +export interface TestInlineFreeformAdditionalPropertiesRequest { + [key: string]: any | any; + /** + * + * @type {string} + * @memberof TestInlineFreeformAdditionalPropertiesRequest + */ + someProperty?: string; +} + +/** + * Check if a given object implements the TestInlineFreeformAdditionalPropertiesRequest interface. + */ +export function instanceOfTestInlineFreeformAdditionalPropertiesRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TestInlineFreeformAdditionalPropertiesRequestFromJSON(json: any): TestInlineFreeformAdditionalPropertiesRequest { + return TestInlineFreeformAdditionalPropertiesRequestFromJSONTyped(json, false); +} + +export function TestInlineFreeformAdditionalPropertiesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestInlineFreeformAdditionalPropertiesRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + ...json, + 'someProperty': !exists(json, 'someProperty') ? undefined : json['someProperty'], + }; +} + +export function TestInlineFreeformAdditionalPropertiesRequestToJSON(value?: TestInlineFreeformAdditionalPropertiesRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + ...value, + 'someProperty': value.someProperty, + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts index 1789038a2d9..d29ec301292 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts @@ -48,4 +48,5 @@ export * from './Return'; export * from './SingleRefType'; export * from './SpecialModelName'; export * from './Tag'; +export * from './TestInlineFreeformAdditionalPropertiesRequest'; export * from './User'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index 9507ce9ce3f..1a5e5be7594 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -56,6 +56,7 @@ doc/SingleRefType.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md +doc/TestInlineFreeformAdditionalPropertiesRequest.md doc/User.md doc/UserApi.md lib/openapi.dart @@ -121,5 +122,6 @@ lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart +lib/src/model/test_inline_freeform_additional_properties_request.dart lib/src/model/user.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index 42ba566440d..e5b72ea2f53 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -83,6 +83,7 @@ Class | Method | HTTP request | Description [*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testInlineFreeformAdditionalProperties**](doc/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [*FakeApi*](doc/FakeApi.md) | [**testNullable**](doc/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property [*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -160,6 +161,7 @@ Class | Method | HTTP request | Description - [SingleRefType](doc/SingleRefType.md) - [SpecialModelName](doc/SpecialModelName.md) - [Tag](doc/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](doc/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](doc/User.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md index 41328617a63..4150c48f581 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md @@ -25,6 +25,7 @@ Method | HTTP request | Description [**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -757,6 +758,48 @@ 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) +# **testInlineFreeformAdditionalProperties** +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = ; // TestInlineFreeformAdditionalPropertiesRequest | request body + +try { + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineFreeformAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..e2b2f1fd446 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,15 @@ +# openapi.model.TestInlineFreeformAdditionalPropertiesRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 81f241899a7..0d9629c9782 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -64,4 +64,5 @@ export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart index 8335114effd..8d73ba41291 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -18,6 +18,7 @@ import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { @@ -1311,6 +1312,71 @@ _bodyData=jsonEncode(requestBody); return _response; } + /// test inline free-form additionalProperties + /// + /// + /// Parameters: + /// * [testInlineFreeformAdditionalPropertiesRequest] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testInlineFreeformAdditionalProperties({ + required TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-freeform-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(testInlineFreeformAdditionalPropertiesRequest); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + /// test json serialization of form data /// /// diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart index 6a8bc0d4704..606d5e08f0d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -40,6 +40,7 @@ import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/read_only_first.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; import 'package:openapi/src/model/user.dart'; final _regList = RegExp(r'^List<(.*)>$'); @@ -162,6 +163,8 @@ final _regMap = RegExp(r'^Map$'); return SpecialModelName.fromJson(value as Map) as ReturnType; case 'Tag': return Tag.fromJson(value as Map) as ReturnType; + case 'TestInlineFreeformAdditionalPropertiesRequest': + return TestInlineFreeformAdditionalPropertiesRequest.fromJson(value as Map) as ReturnType; case 'User': return User.fromJson(value as Map) as ReturnType; default: diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart new file mode 100644 index 00000000000..f00e1d91eb5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'test_inline_freeform_additional_properties_request.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TestInlineFreeformAdditionalPropertiesRequest { + /// Returns a new [TestInlineFreeformAdditionalPropertiesRequest] instance. + TestInlineFreeformAdditionalPropertiesRequest({ + + this.someProperty, + }); + + @JsonKey( + + name: r'someProperty', + required: false, + includeIfNull: false + ) + + + final String? someProperty; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && + other.someProperty == someProperty; + + @override + int get hashCode => + someProperty.hashCode; + + factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); + + Map toJson() => _$TestInlineFreeformAdditionalPropertiesRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/test_inline_freeform_additional_properties_request_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/test_inline_freeform_additional_properties_request_test.dart new file mode 100644 index 00000000000..8c60d3f11f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/test_inline_freeform_additional_properties_request_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestInlineFreeformAdditionalPropertiesRequest +void main() { + final TestInlineFreeformAdditionalPropertiesRequest? instance = /* TestInlineFreeformAdditionalPropertiesRequest(...) */ null; + // TODO add properties to the entity + + group(TestInlineFreeformAdditionalPropertiesRequest, () { + // String someProperty + test('to test the property `someProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index b6f2734cf3f..21ad1188dd9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -55,6 +55,7 @@ doc/SingleRefType.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md +doc/TestInlineFreeformAdditionalPropertiesRequest.md doc/User.md doc/UserApi.md lib/openapi.dart @@ -122,6 +123,7 @@ lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart +lib/src/model/test_inline_freeform_additional_properties_request.dart lib/src/model/user.dart lib/src/serializers.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index 489ec4bec47..0e1527c3417 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description [*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testInlineFreeformAdditionalProperties**](doc/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [*FakeApi*](doc/FakeApi.md) | [**testNullable**](doc/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property [*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -159,6 +160,7 @@ Class | Method | HTTP request | Description - [SingleRefType](doc/SingleRefType.md) - [SpecialModelName](doc/SpecialModelName.md) - [Tag](doc/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](doc/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](doc/User.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md index 5caf751f1f4..d0ea016b30a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -25,6 +25,7 @@ Method | HTTP request | Description [**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -757,6 +758,48 @@ 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) +# **testInlineFreeformAdditionalProperties** +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = ; // TestInlineFreeformAdditionalPropertiesRequest | request body + +try { + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineFreeformAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..e2b2f1fd446 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,15 @@ +# openapi.model.TestInlineFreeformAdditionalPropertiesRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 1c2b397af32..8bb0e47afdb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -65,4 +65,5 @@ export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart index da3ce4b0768..eeceedf3192 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -20,6 +20,7 @@ import 'package:openapi/src/model/model_enum_class.dart'; import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { @@ -1376,6 +1377,73 @@ class FakeApi { return _response; } + /// test inline free-form additionalProperties + /// + /// + /// Parameters: + /// * [testInlineFreeformAdditionalPropertiesRequest] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testInlineFreeformAdditionalProperties({ + required TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-freeform-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(TestInlineFreeformAdditionalPropertiesRequest); + _bodyData = _serializers.serialize(testInlineFreeformAdditionalPropertiesRequest, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + /// test json serialization of form data /// /// diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart new file mode 100644 index 00000000000..3bc31dc96e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'test_inline_freeform_additional_properties_request.g.dart'; + +/// TestInlineFreeformAdditionalPropertiesRequest +/// +/// Properties: +/// * [someProperty] +@BuiltValue() +abstract class TestInlineFreeformAdditionalPropertiesRequest implements Built { + @BuiltValueField(wireName: r'someProperty') + String? get someProperty; + + TestInlineFreeformAdditionalPropertiesRequest._(); + + factory TestInlineFreeformAdditionalPropertiesRequest([void updates(TestInlineFreeformAdditionalPropertiesRequestBuilder b)]) = _$TestInlineFreeformAdditionalPropertiesRequest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TestInlineFreeformAdditionalPropertiesRequestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TestInlineFreeformAdditionalPropertiesRequestSerializer(); +} + +class _$TestInlineFreeformAdditionalPropertiesRequestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [TestInlineFreeformAdditionalPropertiesRequest, _$TestInlineFreeformAdditionalPropertiesRequest]; + + @override + final String wireName = r'TestInlineFreeformAdditionalPropertiesRequest'; + + Iterable _serializeProperties( + Serializers serializers, + TestInlineFreeformAdditionalPropertiesRequest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.someProperty != null) { + yield r'someProperty'; + yield serializers.serialize( + object.someProperty, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + TestInlineFreeformAdditionalPropertiesRequest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TestInlineFreeformAdditionalPropertiesRequestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'someProperty': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.someProperty = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + TestInlineFreeformAdditionalPropertiesRequest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TestInlineFreeformAdditionalPropertiesRequestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart index d4d742a42c2..483a35e9277 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart @@ -62,6 +62,7 @@ import 'package:openapi/src/model/read_only_first.dart'; import 'package:openapi/src/model/single_ref_type.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; import 'package:openapi/src/model/user.dart'; part 'serializers.g.dart'; @@ -115,6 +116,7 @@ part 'serializers.g.dart'; SingleRefType, SpecialModelName, Tag, + TestInlineFreeformAdditionalPropertiesRequest, User, ]) Serializers serializers = (_$serializers.toBuilder() diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart new file mode 100644 index 00000000000..4dddb899f21 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for TestInlineFreeformAdditionalPropertiesRequest +void main() { + final instance = TestInlineFreeformAdditionalPropertiesRequestBuilder(); + // TODO add properties to the builder and call build() + + group(TestInlineFreeformAdditionalPropertiesRequest, () { + // String someProperty + test('to test the property `someProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES index f9f1005bc08..fbfe8cdd180 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES @@ -56,6 +56,7 @@ doc/SingleRefType.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md +doc/TestInlineFreeformAdditionalPropertiesRequest.md doc/User.md doc/UserApi.md git_push.sh @@ -123,5 +124,6 @@ lib/model/read_only_first.dart lib/model/single_ref_type.dart lib/model/special_model_name.dart lib/model/tag.dart +lib/model/test_inline_freeform_additional_properties_request.dart lib/model/user.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md index 9d0fed4ca85..5b27fc4cd9e 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md @@ -76,6 +76,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](doc//FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](doc//FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](doc//FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](doc//FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](doc//FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testNullable**](doc//FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property *FakeApi* | [**testQueryParameterCollectionFormat**](doc//FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -153,6 +154,7 @@ Class | Method | HTTP request | Description - [SingleRefType](doc//SingleRefType.md) - [SpecialModelName](doc//SpecialModelName.md) - [Tag](doc//Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](doc//TestInlineFreeformAdditionalPropertiesRequest.md) - [User](doc//User.md) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md index ee87ce7bafd..129189d8ce1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md @@ -25,6 +25,7 @@ Method | HTTP request | Description [**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | @@ -763,6 +764,48 @@ 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) +# **testInlineFreeformAdditionalProperties** +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api_instance = FakeApi(); +final testInlineFreeformAdditionalPropertiesRequest = TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + +try { + api_instance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); +} catch (e) { + print('Exception when calling FakeApi->testInlineFreeformAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..e2b2f1fd446 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,15 @@ +# openapi.model.TestInlineFreeformAdditionalPropertiesRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someProperty** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart index 167a8a32b6c..61b5ba4d2e1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart @@ -84,6 +84,7 @@ part 'model/read_only_first.dart'; part 'model/single_ref_type.dart'; part 'model/special_model_name.dart'; part 'model/tag.dart'; +part 'model/test_inline_freeform_additional_properties_request.dart'; part 'model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart index 2873d1bcd75..50ff096df27 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart @@ -1069,6 +1069,56 @@ class FakeApi { } } + /// test inline free-form additionalProperties + /// + /// + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [TestInlineFreeformAdditionalPropertiesRequest] testInlineFreeformAdditionalPropertiesRequest (required): + /// request body + Future testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest,) async { + // ignore: prefer_const_declarations + final path = r'/fake/inline-freeform-additionalProperties'; + + // ignore: prefer_final_locals + Object? postBody = testInlineFreeformAdditionalPropertiesRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// test inline free-form additionalProperties + /// + /// + /// + /// Parameters: + /// + /// * [TestInlineFreeformAdditionalPropertiesRequest] testInlineFreeformAdditionalPropertiesRequest (required): + /// request body + Future testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest,) async { + final response = await testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + } + /// test json serialization of form data /// /// diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart index 7f4bd6b0567..32142807294 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart @@ -278,6 +278,8 @@ class ApiClient { return SpecialModelName.fromJson(value); case 'Tag': return Tag.fromJson(value); + case 'TestInlineFreeformAdditionalPropertiesRequest': + return TestInlineFreeformAdditionalPropertiesRequest.fromJson(value); case 'User': return User.fromJson(value); default: diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart new file mode 100644 index 00000000000..664293606b0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/test_inline_freeform_additional_properties_request.dart @@ -0,0 +1,118 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class TestInlineFreeformAdditionalPropertiesRequest { + /// Returns a new [TestInlineFreeformAdditionalPropertiesRequest] instance. + TestInlineFreeformAdditionalPropertiesRequest({ + this.someProperty, + }); + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? someProperty; + + @override + bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && + other.someProperty == someProperty; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (someProperty == null ? 0 : someProperty!.hashCode); + + @override + String toString() => 'TestInlineFreeformAdditionalPropertiesRequest[someProperty=$someProperty]'; + + Map toJson() { + final json = {}; + if (this.someProperty != null) { + json[r'someProperty'] = this.someProperty; + } else { + json[r'someProperty'] = null; + } + return json; + } + + /// Returns a new [TestInlineFreeformAdditionalPropertiesRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TestInlineFreeformAdditionalPropertiesRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "TestInlineFreeformAdditionalPropertiesRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "TestInlineFreeformAdditionalPropertiesRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return TestInlineFreeformAdditionalPropertiesRequest( + someProperty: mapValueOfType(json, r'someProperty'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = TestInlineFreeformAdditionalPropertiesRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TestInlineFreeformAdditionalPropertiesRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of TestInlineFreeformAdditionalPropertiesRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = TestInlineFreeformAdditionalPropertiesRequest.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart new file mode 100644 index 00000000000..b6ad45db259 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/test_inline_freeform_additional_properties_request_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TestInlineFreeformAdditionalPropertiesRequest +void main() { + // final instance = TestInlineFreeformAdditionalPropertiesRequest(); + + group('test TestInlineFreeformAdditionalPropertiesRequest', () { + // String someProperty + test('to test the property `someProperty`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES index 0c94fa4a708..f88919b2eb4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -76,6 +76,7 @@ docs/Return.md docs/SpecialModelName.md docs/StoreAPI.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserAPI.md docs/Whale.md @@ -142,6 +143,7 @@ model_read_only_first.go model_read_only_with_default.go model_return.go model_tag.go +model_test_inline_freeform_additional_properties_request.go model_user.go model_whale.go model_zebra.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 2b3afc6a318..262cba3e199 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -93,6 +93,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**TestEnumParameters**](docs/FakeAPI.md#testenumparameters) | **Get** /fake | To test enum parameters *FakeAPI* | [**TestGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**TestInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +*FakeAPI* | [**TestInlineFreeformAdditionalProperties**](docs/FakeAPI.md#testinlinefreeformadditionalproperties) | **Post** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeAPI* | [**TestJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data *FakeAPI* | [**TestQueryDeepObject**](docs/FakeAPI.md#testquerydeepobject) | **Get** /fake/deep_object_test | *FakeAPI* | [**TestQueryParameterCollectionFormat**](docs/FakeAPI.md#testqueryparametercollectionformat) | **Put** /fake/test-query-parameters | @@ -182,6 +183,7 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [User](docs/User.md) - [Whale](docs/Whale.md) - [Zebra](docs/Zebra.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 55caa397f93..f008fd5193a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -925,6 +925,23 @@ paths: summary: test inline additionalProperties tags: - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2215,6 +2232,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 4b36fb36c75..1cccc452d97 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -197,6 +197,19 @@ type FakeAPI interface { // TestInlineAdditionalPropertiesExecute executes the request TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*http.Response, error) + /* + TestInlineFreeformAdditionalProperties test inline free-form additionalProperties + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestInlineFreeformAdditionalPropertiesRequest + */ + TestInlineFreeformAdditionalProperties(ctx context.Context) ApiTestInlineFreeformAdditionalPropertiesRequest + + // TestInlineFreeformAdditionalPropertiesExecute executes the request + TestInlineFreeformAdditionalPropertiesExecute(r ApiTestInlineFreeformAdditionalPropertiesRequest) (*http.Response, error) + /* TestJsonFormData test json serialization of form data @@ -1930,6 +1943,106 @@ func (a *FakeAPIService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, nil } +type ApiTestInlineFreeformAdditionalPropertiesRequest struct { + ctx context.Context + ApiService FakeAPI + testInlineFreeformAdditionalPropertiesRequest *TestInlineFreeformAdditionalPropertiesRequest +} + +// request body +func (r ApiTestInlineFreeformAdditionalPropertiesRequest) TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest TestInlineFreeformAdditionalPropertiesRequest) ApiTestInlineFreeformAdditionalPropertiesRequest { + r.testInlineFreeformAdditionalPropertiesRequest = &testInlineFreeformAdditionalPropertiesRequest + return r +} + +func (r ApiTestInlineFreeformAdditionalPropertiesRequest) Execute() (*http.Response, error) { + return r.ApiService.TestInlineFreeformAdditionalPropertiesExecute(r) +} + +/* +TestInlineFreeformAdditionalProperties test inline free-form additionalProperties + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestInlineFreeformAdditionalPropertiesRequest +*/ +func (a *FakeAPIService) TestInlineFreeformAdditionalProperties(ctx context.Context) ApiTestInlineFreeformAdditionalPropertiesRequest { + return ApiTestInlineFreeformAdditionalPropertiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *FakeAPIService) TestInlineFreeformAdditionalPropertiesExecute(r ApiTestInlineFreeformAdditionalPropertiesRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeAPIService.TestInlineFreeformAdditionalProperties") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/inline-freeform-additionalProperties" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.testInlineFreeformAdditionalPropertiesRequest == nil { + return nil, reportError("testInlineFreeformAdditionalPropertiesRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.testInlineFreeformAdditionalPropertiesRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiTestJsonFormDataRequest struct { ctx context.Context ApiService FakeAPI diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md index 41d1d980bc6..87d1d6443e9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestEnumParameters**](FakeAPI.md#TestEnumParameters) | **Get** /fake | To test enum parameters [**TestGroupParameters**](FakeAPI.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeAPI.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +[**TestInlineFreeformAdditionalProperties**](FakeAPI.md#TestInlineFreeformAdditionalProperties) | **Post** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**TestJsonFormData**](FakeAPI.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data [**TestQueryDeepObject**](FakeAPI.md#TestQueryDeepObject) | **Get** /fake/deep_object_test | [**TestQueryParameterCollectionFormat**](FakeAPI.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-parameters | @@ -916,6 +917,70 @@ No authorization required [[Back to README]](../README.md) +## TestInlineFreeformAdditionalProperties + +> TestInlineFreeformAdditionalProperties(ctx).TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest).Execute() + +test inline free-form additionalProperties + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + testInlineFreeformAdditionalPropertiesRequest := *openapiclient.NewTestInlineFreeformAdditionalPropertiesRequest() // TestInlineFreeformAdditionalPropertiesRequest | request body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestInlineFreeformAdditionalProperties(context.Background()).TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineFreeformAdditionalProperties``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestInlineFreeformAdditionalPropertiesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + ## TestJsonFormData > TestJsonFormData(ctx).Param(param).Param2(param2).Execute() diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..e4bb335bf67 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,56 @@ +# TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | Pointer to **string** | | [optional] + +## Methods + +### NewTestInlineFreeformAdditionalPropertiesRequest + +`func NewTestInlineFreeformAdditionalPropertiesRequest() *TestInlineFreeformAdditionalPropertiesRequest` + +NewTestInlineFreeformAdditionalPropertiesRequest instantiates a new TestInlineFreeformAdditionalPropertiesRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTestInlineFreeformAdditionalPropertiesRequestWithDefaults + +`func NewTestInlineFreeformAdditionalPropertiesRequestWithDefaults() *TestInlineFreeformAdditionalPropertiesRequest` + +NewTestInlineFreeformAdditionalPropertiesRequestWithDefaults instantiates a new TestInlineFreeformAdditionalPropertiesRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSomeProperty + +`func (o *TestInlineFreeformAdditionalPropertiesRequest) GetSomeProperty() string` + +GetSomeProperty returns the SomeProperty field if non-nil, zero value otherwise. + +### GetSomePropertyOk + +`func (o *TestInlineFreeformAdditionalPropertiesRequest) GetSomePropertyOk() (*string, bool)` + +GetSomePropertyOk returns a tuple with the SomeProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSomeProperty + +`func (o *TestInlineFreeformAdditionalPropertiesRequest) SetSomeProperty(v string)` + +SetSomeProperty sets SomeProperty field to given value. + +### HasSomeProperty + +`func (o *TestInlineFreeformAdditionalPropertiesRequest) HasSomeProperty() bool` + +HasSomeProperty returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_test_inline_freeform_additional_properties_request.go b/samples/openapi3/client/petstore/go/go-petstore/model_test_inline_freeform_additional_properties_request.go new file mode 100644 index 00000000000..6e3866edc91 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/model_test_inline_freeform_additional_properties_request.go @@ -0,0 +1,155 @@ +/* +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore + +import ( + "encoding/json" +) + +// checks if the TestInlineFreeformAdditionalPropertiesRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TestInlineFreeformAdditionalPropertiesRequest{} + +// TestInlineFreeformAdditionalPropertiesRequest struct for TestInlineFreeformAdditionalPropertiesRequest +type TestInlineFreeformAdditionalPropertiesRequest struct { + SomeProperty *string `json:"someProperty,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TestInlineFreeformAdditionalPropertiesRequest TestInlineFreeformAdditionalPropertiesRequest + +// NewTestInlineFreeformAdditionalPropertiesRequest instantiates a new TestInlineFreeformAdditionalPropertiesRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTestInlineFreeformAdditionalPropertiesRequest() *TestInlineFreeformAdditionalPropertiesRequest { + this := TestInlineFreeformAdditionalPropertiesRequest{} + return &this +} + +// NewTestInlineFreeformAdditionalPropertiesRequestWithDefaults instantiates a new TestInlineFreeformAdditionalPropertiesRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTestInlineFreeformAdditionalPropertiesRequestWithDefaults() *TestInlineFreeformAdditionalPropertiesRequest { + this := TestInlineFreeformAdditionalPropertiesRequest{} + return &this +} + +// GetSomeProperty returns the SomeProperty field value if set, zero value otherwise. +func (o *TestInlineFreeformAdditionalPropertiesRequest) GetSomeProperty() string { + if o == nil || IsNil(o.SomeProperty) { + var ret string + return ret + } + return *o.SomeProperty +} + +// GetSomePropertyOk returns a tuple with the SomeProperty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestInlineFreeformAdditionalPropertiesRequest) GetSomePropertyOk() (*string, bool) { + if o == nil || IsNil(o.SomeProperty) { + return nil, false + } + return o.SomeProperty, true +} + +// HasSomeProperty returns a boolean if a field has been set. +func (o *TestInlineFreeformAdditionalPropertiesRequest) HasSomeProperty() bool { + if o != nil && !IsNil(o.SomeProperty) { + return true + } + + return false +} + +// SetSomeProperty gets a reference to the given string and assigns it to the SomeProperty field. +func (o *TestInlineFreeformAdditionalPropertiesRequest) SetSomeProperty(v string) { + o.SomeProperty = &v +} + +func (o TestInlineFreeformAdditionalPropertiesRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TestInlineFreeformAdditionalPropertiesRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SomeProperty) { + toSerialize["someProperty"] = o.SomeProperty + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TestInlineFreeformAdditionalPropertiesRequest) UnmarshalJSON(bytes []byte) (err error) { + varTestInlineFreeformAdditionalPropertiesRequest := _TestInlineFreeformAdditionalPropertiesRequest{} + + err = json.Unmarshal(bytes, &varTestInlineFreeformAdditionalPropertiesRequest) + + if err != nil { + return err + } + + *o = TestInlineFreeformAdditionalPropertiesRequest(varTestInlineFreeformAdditionalPropertiesRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "someProperty") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTestInlineFreeformAdditionalPropertiesRequest struct { + value *TestInlineFreeformAdditionalPropertiesRequest + isSet bool +} + +func (v NullableTestInlineFreeformAdditionalPropertiesRequest) Get() *TestInlineFreeformAdditionalPropertiesRequest { + return v.value +} + +func (v *NullableTestInlineFreeformAdditionalPropertiesRequest) Set(val *TestInlineFreeformAdditionalPropertiesRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTestInlineFreeformAdditionalPropertiesRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTestInlineFreeformAdditionalPropertiesRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTestInlineFreeformAdditionalPropertiesRequest(val *TestInlineFreeformAdditionalPropertiesRequest) *NullableTestInlineFreeformAdditionalPropertiesRequest { + return &NullableTestInlineFreeformAdditionalPropertiesRequest{value: val, isSet: true} +} + +func (v NullableTestInlineFreeformAdditionalPropertiesRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTestInlineFreeformAdditionalPropertiesRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES index d3d27bc86c3..4fbcb8fd20b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -79,6 +79,7 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -188,6 +189,7 @@ src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/client/model/Triangle.java src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/README.md b/samples/openapi3/client/petstore/java/jersey2-java8/README.md index ec767ccff48..15d325d63ac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/README.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/README.md @@ -153,6 +153,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -249,6 +250,7 @@ Class | Method | HTTP request | Description - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Triangle](docs/Triangle.md) - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index 82435d1c056..2dcf21ae0b3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -958,6 +958,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams @@ -2284,6 +2303,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md index 0663bb791e4..83f469863c9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -17,6 +17,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | | [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | | [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | @@ -928,6 +929,70 @@ No authorization required | **200** | successful operation | - | +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.model.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + ## testJsonFormData > testJsonFormData(param, param2) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index a925510e6e3..be2aa6952f0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -17,6 +17,7 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import java.util.ArrayList; @@ -775,6 +776,45 @@ private ApiResponse testGroupParametersWithHttpInfo(Integer requiredString new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, null, null, false); } + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + // Check required parameters + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testInlineFreeformAdditionalProperties", "/fake/inline-freeform-additionalProperties", "POST", new ArrayList<>(), testInlineFreeformAdditionalPropertiesRequest, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); + } /** * test json serialization of form data * diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..a3817d7f7e3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this testInlineFreeformAdditionalProperties_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..556aaa00c72 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES index 7781fa1c1ed..e943667b1f6 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES @@ -84,6 +84,7 @@ docs/SpecialModelName.md docs/SpecialName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Tiger.md docs/User.md docs/UserApi.md @@ -178,6 +179,7 @@ petstore_api/models/special_character_enum.py petstore_api/models/special_model_name.py petstore_api/models/special_name.py petstore_api/models/tag.py +petstore_api/models/test_inline_freeform_additional_properties_request.py petstore_api/models/tiger.py petstore_api/models/user.py petstore_api/models/with_nested_one_of.py diff --git a/samples/openapi3/client/petstore/python-aiohttp/README.md b/samples/openapi3/client/petstore/python-aiohttp/README.md index 5a73c46e3a5..9d3ea6eb22c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-aiohttp/README.md @@ -106,6 +106,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -209,6 +210,7 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [SpecialName](docs/SpecialName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Tiger](docs/Tiger.md) - [User](docs/User.md) - [WithNestedOneOf](docs/WithNestedOneOf.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md index f42fcffd871..be5d5e850c7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | @@ -1370,6 +1371,71 @@ 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) +# **test_inline_freeform_additional_properties** +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Example + +```python +import time +import os +import petstore_api +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +async with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + test_inline_freeform_additional_properties_request = petstore_api.TestInlineFreeformAdditionalPropertiesRequest() # TestInlineFreeformAdditionalPropertiesRequest | request body + + try: + # test inline free-form additionalProperties + await api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + except Exception as e: + print("Exception when calling FakeApi->test_inline_freeform_additional_properties: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + # **test_json_form_data** > test_json_form_data(param, param2) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..7cf86c5244e --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,28 @@ +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string +test_inline_freeform_additional_properties_request_instance = TestInlineFreeformAdditionalPropertiesRequest.from_json(json) +# print the JSON string representation of the object +print TestInlineFreeformAdditionalPropertiesRequest.to_json() + +# convert the object into a dict +test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() +# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict +test_inline_freeform_additional_properties_request_form_dict = test_inline_freeform_additional_properties_request.from_dict(test_inline_freeform_additional_properties_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py index 9803f529712..2023e72fb35 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py @@ -113,6 +113,7 @@ from petstore_api.models.special_character_enum import SpecialCharacterEnum from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.tiger import Tiger from petstore_api.models.user import User from petstore_api.models.with_nested_one_of import WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py index 9bb46314e7e..975e70cad80 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py @@ -34,6 +34,7 @@ from petstore_api.models.outer_composite import OuterComposite from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty from petstore_api.models.pet import Pet from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.user import User from petstore_api.api_client import ApiClient @@ -2597,6 +2598,131 @@ class FakeApi: collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + @validate_arguments + async def test_inline_freeform_additional_properties(self, test_inline_freeform_additional_properties_request : Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(..., description="request body")], **kwargs) -> None: # noqa: E501 + """test inline free-form additionalProperties # noqa: E501 + + # noqa: E501 + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + message = "Error! Please call the test_inline_freeform_additional_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, **kwargs) # noqa: E501 + + @validate_arguments + async def test_inline_freeform_additional_properties_with_http_info(self, test_inline_freeform_additional_properties_request : Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(..., description="request body")], **kwargs) -> ApiResponse: # noqa: E501 + """test inline free-form additionalProperties # noqa: E501 + + # noqa: E501 + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'test_inline_freeform_additional_properties_request' + ] + _all_params.extend( + [ + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_freeform_additional_properties" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['test_inline_freeform_additional_properties_request'] is not None: + _body_params = _params['test_inline_freeform_additional_properties_request'] + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + '/fake/inline-freeform-additionalProperties', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments async def test_json_form_data(self, param : Annotated[StrictStr, Field(..., description="field1")], param2 : Annotated[StrictStr, Field(..., description="field2")], **kwargs) -> None: # noqa: E501 """test json serialization of form data # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py index 5e4468e4b56..e3ce5fa5538 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py @@ -89,6 +89,7 @@ from petstore_api.models.special_character_enum import SpecialCharacterEnum from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.tiger import Tiger from petstore_api.models.user import User from petstore_api.models.with_nested_one_of import WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py new file mode 100644 index 00000000000..a77233c5677 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + +class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): + """ + TestInlineFreeformAdditionalPropertiesRequest + """ + some_property: Optional[StrictStr] = Field(None, alias="someProperty") + additional_properties: Dict[str, Any] = {} + __properties = ["someProperty"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TestInlineFreeformAdditionalPropertiesRequest: + """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TestInlineFreeformAdditionalPropertiesRequest: + """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TestInlineFreeformAdditionalPropertiesRequest.parse_obj(obj) + + _obj = TestInlineFreeformAdditionalPropertiesRequest.parse_obj({ + "some_property": obj.get("someProperty") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_inline_freeform_additional_properties_request.py new file mode 100644 index 00000000000..5c40397bc91 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_inline_freeform_additional_properties_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest # noqa: E501 + +class TestTestInlineFreeformAdditionalPropertiesRequest(unittest.TestCase): + """TestInlineFreeformAdditionalPropertiesRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestInlineFreeformAdditionalPropertiesRequest: + """Test TestInlineFreeformAdditionalPropertiesRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestInlineFreeformAdditionalPropertiesRequest` + """ + model = TestInlineFreeformAdditionalPropertiesRequest() # noqa: E501 + if include_optional: + return TestInlineFreeformAdditionalPropertiesRequest( + some_property = '' + ) + else: + return TestInlineFreeformAdditionalPropertiesRequest( + ) + """ + + def testTestInlineFreeformAdditionalPropertiesRequest(self): + """Test TestInlineFreeformAdditionalPropertiesRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index fdd09778983..a39872b86ce 100755 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -84,6 +84,7 @@ docs/SpecialModelName.md docs/SpecialName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/Tiger.md docs/User.md docs/UserApi.md @@ -178,6 +179,7 @@ petstore_api/models/special_character_enum.py petstore_api/models/special_model_name.py petstore_api/models/special_name.py petstore_api/models/tag.py +petstore_api/models/test_inline_freeform_additional_properties_request.py petstore_api/models/tiger.py petstore_api/models/user.py petstore_api/models/with_nested_one_of.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 7882186348d..e4cc8831876 100755 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -106,6 +106,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -209,6 +210,7 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [SpecialName](docs/SpecialName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Tiger](docs/Tiger.md) - [User](docs/User.md) - [WithNestedOneOf](docs/WithNestedOneOf.md) diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 047af9ef378..5bd0489ae55 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | @@ -1370,6 +1371,71 @@ 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) +# **test_inline_freeform_additional_properties** +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Example + +```python +import time +import os +import petstore_api +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + test_inline_freeform_additional_properties_request = petstore_api.TestInlineFreeformAdditionalPropertiesRequest() # TestInlineFreeformAdditionalPropertiesRequest | request body + + try: + # test inline free-form additionalProperties + api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + except Exception as e: + print("Exception when calling FakeApi->test_inline_freeform_additional_properties: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + # **test_json_form_data** > test_json_form_data(param, param2) diff --git a/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..7cf86c5244e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,28 @@ +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string +test_inline_freeform_additional_properties_request_instance = TestInlineFreeformAdditionalPropertiesRequest.from_json(json) +# print the JSON string representation of the object +print TestInlineFreeformAdditionalPropertiesRequest.to_json() + +# convert the object into a dict +test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() +# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict +test_inline_freeform_additional_properties_request_form_dict = test_inline_freeform_additional_properties_request.from_dict(test_inline_freeform_additional_properties_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py index 9803f529712..2023e72fb35 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -113,6 +113,7 @@ from petstore_api.models.special_character_enum import SpecialCharacterEnum from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.tiger import Tiger from petstore_api.models.user import User from petstore_api.models.with_nested_one_of import WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index fb80af75b0f..a5c02f94ab7 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -33,6 +33,7 @@ from petstore_api.models.outer_composite import OuterComposite from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty from petstore_api.models.pet import Pet from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.user import User from petstore_api.api_client import ApiClient @@ -2900,6 +2901,147 @@ class FakeApi: collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + @validate_arguments + def test_inline_freeform_additional_properties(self, test_inline_freeform_additional_properties_request : Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(..., description="request body")], **kwargs) -> None: # noqa: E501 + """test inline free-form additionalProperties # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request, async_req=True) + >>> result = thread.get() + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + message = "Error! Please call the test_inline_freeform_additional_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, **kwargs) # noqa: E501 + + @validate_arguments + def test_inline_freeform_additional_properties_with_http_info(self, test_inline_freeform_additional_properties_request : Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(..., description="request body")], **kwargs) -> ApiResponse: # noqa: E501 + """test inline free-form additionalProperties # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, async_req=True) + >>> result = thread.get() + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'test_inline_freeform_additional_properties_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_freeform_additional_properties" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['test_inline_freeform_additional_properties_request'] is not None: + _body_params = _params['test_inline_freeform_additional_properties_request'] + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/fake/inline-freeform-additionalProperties', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def test_json_form_data(self, param : Annotated[StrictStr, Field(..., description="field1")], param2 : Annotated[StrictStr, Field(..., description="field2")], **kwargs) -> None: # noqa: E501 """test json serialization of form data # noqa: E501 diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index 5e4468e4b56..e3ce5fa5538 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -89,6 +89,7 @@ from petstore_api.models.special_character_enum import SpecialCharacterEnum from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.tiger import Tiger from petstore_api.models.user import User from petstore_api.models.with_nested_one_of import WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py new file mode 100644 index 00000000000..c61f52a3e9e --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): + """ + TestInlineFreeformAdditionalPropertiesRequest + """ + some_property: Optional[StrictStr] = Field(None, alias="someProperty") + additional_properties: Dict[str, Any] = {} + __properties = ["someProperty"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TestInlineFreeformAdditionalPropertiesRequest: + """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TestInlineFreeformAdditionalPropertiesRequest: + """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TestInlineFreeformAdditionalPropertiesRequest.parse_obj(obj) + + _obj = TestInlineFreeformAdditionalPropertiesRequest.parse_obj({ + "some_property": obj.get("someProperty") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python/test/test_test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python/test/test_test_inline_freeform_additional_properties_request.py new file mode 100644 index 00000000000..5c40397bc91 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_test_inline_freeform_additional_properties_request.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest # noqa: E501 + +class TestTestInlineFreeformAdditionalPropertiesRequest(unittest.TestCase): + """TestInlineFreeformAdditionalPropertiesRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestInlineFreeformAdditionalPropertiesRequest: + """Test TestInlineFreeformAdditionalPropertiesRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestInlineFreeformAdditionalPropertiesRequest` + """ + model = TestInlineFreeformAdditionalPropertiesRequest() # noqa: E501 + if include_optional: + return TestInlineFreeformAdditionalPropertiesRequest( + some_property = '' + ) + else: + return TestInlineFreeformAdditionalPropertiesRequest( + ) + """ + + def testTestInlineFreeformAdditionalPropertiesRequest(self): + """Test TestInlineFreeformAdditionalPropertiesRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/schema/petstore/mysql/.openapi-generator/FILES b/samples/schema/petstore/mysql/.openapi-generator/FILES index a70d72bf53b..4d6edb4c79c 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/FILES +++ b/samples/schema/petstore/mysql/.openapi-generator/FILES @@ -46,6 +46,7 @@ Model/Return.sql Model/SingleRefType.sql Model/SpecialModelName.sql Model/Tag.sql +Model/TestInlineFreeformAdditionalPropertiesRequest.sql Model/User.sql README.md mysql_schema.sql diff --git a/samples/schema/petstore/mysql/Model/TestInlineFreeformAdditionalPropertiesRequest.sql b/samples/schema/petstore/mysql/Model/TestInlineFreeformAdditionalPropertiesRequest.sql new file mode 100644 index 00000000000..6f3a8c0adef --- /dev/null +++ b/samples/schema/petstore/mysql/Model/TestInlineFreeformAdditionalPropertiesRequest.sql @@ -0,0 +1,26 @@ +-- +-- OpenAPI Petstore. +-- Prepared SQL queries for 'testInlineFreeformAdditionalProperties_request' definition. +-- + + +-- +-- SELECT template for table `testInlineFreeformAdditionalProperties_request` +-- +SELECT `someProperty` FROM `testInlineFreeformAdditionalProperties_request` WHERE 1; + +-- +-- INSERT template for table `testInlineFreeformAdditionalProperties_request` +-- +INSERT INTO `testInlineFreeformAdditionalProperties_request`(`someProperty`) VALUES (?); + +-- +-- UPDATE template for table `testInlineFreeformAdditionalProperties_request` +-- +UPDATE `testInlineFreeformAdditionalProperties_request` SET `someProperty` = ? WHERE 1; + +-- +-- DELETE template for table `testInlineFreeformAdditionalProperties_request` +-- +DELETE FROM `testInlineFreeformAdditionalProperties_request` WHERE 0; + diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index 30257267116..0c526bdabd3 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -430,6 +430,14 @@ CREATE TABLE IF NOT EXISTS `Tag` ( `name` TEXT DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `testInlineFreeformAdditionalProperties_request` generated from model 'testInlineFreeformAdditionalPropertiesUnderscorerequest' +-- + +CREATE TABLE IF NOT EXISTS `testInlineFreeformAdditionalProperties_request` ( + `someProperty` TEXT DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `User` generated from model 'User' -- diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES b/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES index 97c17ae836f..555edbf624d 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES +++ b/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES @@ -107,6 +107,8 @@ model/SingleRefType.cpp model/SingleRefType.h model/Tag.cpp model/Tag.h +model/TestInlineFreeformAdditionalProperties_request.cpp +model/TestInlineFreeformAdditionalProperties_request.h model/User.cpp model/User.h model/_foo_get_default_response.cpp diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp index af6ffd9863f..b8d7c742d36 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp +++ b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.cpp @@ -1791,6 +1791,119 @@ std::string FakeInline_additionalPropertiesResource::extractFormParamsFromBody(c } return ""; } +FakeInline_freeform_additionalPropertiesResource::FakeInline_freeform_additionalPropertiesResource(const std::string& context /* = "/v2" */) +{ + this->set_path(context + "/fake/inline-freeform-additionalProperties"); + this->set_method_handler("POST", + std::bind(&FakeInline_freeform_additionalPropertiesResource::handler_POST_internal, this, + std::placeholders::_1)); +} + +std::pair FakeInline_freeform_additionalPropertiesResource::handleFakeApiException(const FakeApiException& e) +{ + return std::make_pair(e.getStatus(), e.what()); +} + +std::pair FakeInline_freeform_additionalPropertiesResource::handleStdException(const std::exception& e) +{ + return std::make_pair(500, e.what()); +} + +std::pair FakeInline_freeform_additionalPropertiesResource::handleUnspecifiedException() +{ + return std::make_pair(500, "Unknown exception occurred"); +} + +void FakeInline_freeform_additionalPropertiesResource::setResponseHeader(const std::shared_ptr& session, const std::string& header) +{ + session->set_header(header, ""); +} + +void FakeInline_freeform_additionalPropertiesResource::returnResponse(const std::shared_ptr& session, const int status, const std::string& result, std::multimap& responseHeaders) +{ + responseHeaders.insert(std::make_pair("Connection", "close")); + session->close(status, result, responseHeaders); +} + +void FakeInline_freeform_additionalPropertiesResource::defaultSessionClose(const std::shared_ptr& session, const int status, const std::string& result) +{ + session->close(status, result, { {"Connection", "close"} }); +} + +void FakeInline_freeform_additionalPropertiesResource::handler_POST_internal(const std::shared_ptr session) +{ + const auto request = session->get_request(); + // body params or form params here from the body content string + std::string bodyContent = extractBodyContent(session); + auto testInlineFreeformAdditionalPropertiesRequest = extractJsonModelBodyParam(bodyContent); + + int status_code = 500; + std::string result = ""; + + try { + status_code = + handler_POST(testInlineFreeformAdditionalPropertiesRequest); + } + catch(const FakeApiException& e) { + std::tie(status_code, result) = handleFakeApiException(e); + } + catch(const std::exception& e) { + std::tie(status_code, result) = handleStdException(e); + } + catch(...) { + std::tie(status_code, result) = handleUnspecifiedException(); + } + + std::multimap< std::string, std::string > responseHeaders {}; + static const std::vector contentTypes{ + "application/json" + }; + static const std::string acceptTypes{ + "application/json, " + }; + + if (status_code == 200) { + responseHeaders.insert(std::make_pair("Content-Type", selectPreferredContentType(contentTypes))); + if (!acceptTypes.empty()) { + responseHeaders.insert(std::make_pair("Accept", acceptTypes)); + } + + returnResponse(session, 200, result.empty() ? "{}" : result, responseHeaders); + return; + } + defaultSessionClose(session, status_code, result); +} + + +int FakeInline_freeform_additionalPropertiesResource::handler_POST( + TestInlineFreeformAdditionalProperties_request & testInlineFreeformAdditionalPropertiesRequest) +{ + return handler_POST_func(testInlineFreeformAdditionalPropertiesRequest); +} + + +std::string FakeInline_freeform_additionalPropertiesResource::extractBodyContent(const std::shared_ptr& session) { + const auto request = session->get_request(); + int content_length = request->get_header("Content-Length", 0); + std::string bodyContent; + session->fetch(content_length, + [&bodyContent](const std::shared_ptr session, + const restbed::Bytes &body) { + bodyContent = restbed::String::format( + "%.*s\n", (int)body.size(), body.data()); + }); + return bodyContent; +} + +std::string FakeInline_freeform_additionalPropertiesResource::extractFormParamsFromBody(const std::string& paramName, const std::string& body) { + const auto uri = restbed::Uri("urlencoded?" + body, true); + const auto params = uri.get_query_parameters(); + const auto result = params.find(paramName); + if (result != params.cend()) { + return result->second; + } + return ""; +} FakeJsonFormDataResource::FakeJsonFormDataResource(const std::string& context /* = "/v2" */) { this->set_path(context + "/fake/jsonFormData"); @@ -2247,6 +2360,12 @@ std::shared_ptr FakeA } return m_spFakeInline_additionalPropertiesResource; } +std::shared_ptr FakeApi::getFakeInline_freeform_additionalPropertiesResource() { + if (!m_spFakeInline_freeform_additionalPropertiesResource) { + setResource(std::make_shared()); + } + return m_spFakeInline_freeform_additionalPropertiesResource; +} std::shared_ptr FakeApi::getFakeJsonFormDataResource() { if (!m_spFakeJsonFormDataResource) { setResource(std::make_shared()); @@ -2317,6 +2436,10 @@ void FakeApi::setResource(std::shared_ptrpublish(m_spFakeInline_additionalPropertiesResource); } +void FakeApi::setResource(std::shared_ptr resource) { + m_spFakeInline_freeform_additionalPropertiesResource = resource; + m_service->publish(m_spFakeInline_freeform_additionalPropertiesResource); +} void FakeApi::setResource(std::shared_ptr resource) { m_spFakeJsonFormDataResource = resource; m_service->publish(m_spFakeJsonFormDataResource); @@ -2381,6 +2504,10 @@ void FakeApi::setFakeApiFakeInline_additionalPropertiesResource(std::shared_ptr< m_spFakeInline_additionalPropertiesResource = spFakeInline_additionalPropertiesResource; m_service->publish(m_spFakeInline_additionalPropertiesResource); } +void FakeApi::setFakeApiFakeInline_freeform_additionalPropertiesResource(std::shared_ptr spFakeInline_freeform_additionalPropertiesResource) { + m_spFakeInline_freeform_additionalPropertiesResource = spFakeInline_freeform_additionalPropertiesResource; + m_service->publish(m_spFakeInline_freeform_additionalPropertiesResource); +} void FakeApi::setFakeApiFakeJsonFormDataResource(std::shared_ptr spFakeJsonFormDataResource) { m_spFakeJsonFormDataResource = spFakeJsonFormDataResource; m_service->publish(m_spFakeJsonFormDataResource); @@ -2435,6 +2562,9 @@ void FakeApi::publishDefaultResources() { if (!m_spFakeInline_additionalPropertiesResource) { setResource(std::make_shared()); } + if (!m_spFakeInline_freeform_additionalPropertiesResource) { + setResource(std::make_shared()); + } if (!m_spFakeJsonFormDataResource) { setResource(std::make_shared()); } diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h index 12b24bcae82..61514147a05 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h +++ b/samples/server/petstore/cpp-restbed/generated/3_0/api/FakeApi.h @@ -40,6 +40,7 @@ #include "OuterComposite.h" #include "OuterObjectWithEnumProperty.h" #include "Pet.h" +#include "TestInlineFreeformAdditionalProperties_request.h" #include "User.h" #include #include @@ -875,6 +876,68 @@ protected: std::map & requestBody); +protected: + ////////////////////////////////////// + // Override these for customization // + ////////////////////////////////////// + + virtual std::string extractBodyContent(const std::shared_ptr& session); + virtual std::string extractFormParamsFromBody(const std::string& paramName, const std::string& body); + + virtual std::pair handleFakeApiException(const FakeApiException& e); + virtual std::pair handleStdException(const std::exception& e); + virtual std::pair handleUnspecifiedException(); + + virtual void setResponseHeader(const std::shared_ptr& session, + const std::string& header); + + virtual void returnResponse(const std::shared_ptr& session, + const int status, const std::string& result, std::multimap& contentType); + virtual void defaultSessionClose(const std::shared_ptr& session, + const int status, const std::string& result); + +private: + void handler_POST_internal(const std::shared_ptr session); +}; + +/// +/// test inline free-form additionalProperties +/// +/// +/// +/// +class FakeInline_freeform_additionalPropertiesResource: public restbed::Resource +{ +public: + FakeInline_freeform_additionalPropertiesResource(const std::string& context = "/v2"); + virtual ~FakeInline_freeform_additionalPropertiesResource() = default; + + FakeInline_freeform_additionalPropertiesResource( + const FakeInline_freeform_additionalPropertiesResource& other) = default; // copy constructor + FakeInline_freeform_additionalPropertiesResource(FakeInline_freeform_additionalPropertiesResource&& other) noexcept = default; // move constructor + + FakeInline_freeform_additionalPropertiesResource& operator=(const FakeInline_freeform_additionalPropertiesResource& other) = default; // copy assignment + FakeInline_freeform_additionalPropertiesResource& operator=(FakeInline_freeform_additionalPropertiesResource&& other) noexcept = default; // move assignment + + ///////////////////////////////////////////////////// + // Set these to implement the server functionality // + ///////////////////////////////////////////////////// + std::function handler_POST_func = + [](TestInlineFreeformAdditionalProperties_request &) -> int + { throw FakeApiException(501, "Not implemented"); }; + + +protected: + ////////////////////////////////////////////////////////// + // As an alternative to setting the `std::function`s // + // override these to implement the server functionality // + ////////////////////////////////////////////////////////// + + virtual int handler_POST( + TestInlineFreeformAdditionalProperties_request & testInlineFreeformAdditionalPropertiesRequest); + + protected: ////////////////////////////////////// // Override these for customization // @@ -1100,6 +1163,7 @@ using FakeApiFakeBody_with_file_schemaResource [[deprecated]] = FakeApiResources using FakeApiFakeBody_with_query_paramsResource [[deprecated]] = FakeApiResources::FakeBody_with_query_paramsResource; using FakeApiFakeResource [[deprecated]] = FakeApiResources::FakeResource; using FakeApiFakeInline_additionalPropertiesResource [[deprecated]] = FakeApiResources::FakeInline_additionalPropertiesResource; +using FakeApiFakeInline_freeform_additionalPropertiesResource [[deprecated]] = FakeApiResources::FakeInline_freeform_additionalPropertiesResource; using FakeApiFakeJsonFormDataResource [[deprecated]] = FakeApiResources::FakeJsonFormDataResource; using FakeApiFakeNullableResource [[deprecated]] = FakeApiResources::FakeNullableResource; using FakeApiFakeTest_query_parametersResource [[deprecated]] = FakeApiResources::FakeTest_query_parametersResource; @@ -1126,6 +1190,7 @@ public: std::shared_ptr getFakeBody_with_query_paramsResource(); std::shared_ptr getFakeResource(); std::shared_ptr getFakeInline_additionalPropertiesResource(); + std::shared_ptr getFakeInline_freeform_additionalPropertiesResource(); std::shared_ptr getFakeJsonFormDataResource(); std::shared_ptr getFakeNullableResource(); std::shared_ptr getFakeTest_query_parametersResource(); @@ -1143,6 +1208,7 @@ public: void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); + void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); @@ -1173,6 +1239,8 @@ public: [[deprecated("use setResource()")]] virtual void setFakeApiFakeInline_additionalPropertiesResource(std::shared_ptr spFakeApiFakeInline_additionalPropertiesResource); [[deprecated("use setResource()")]] + virtual void setFakeApiFakeInline_freeform_additionalPropertiesResource(std::shared_ptr spFakeApiFakeInline_freeform_additionalPropertiesResource); + [[deprecated("use setResource()")]] virtual void setFakeApiFakeJsonFormDataResource(std::shared_ptr spFakeApiFakeJsonFormDataResource); [[deprecated("use setResource()")]] virtual void setFakeApiFakeNullableResource(std::shared_ptr spFakeApiFakeNullableResource); @@ -1197,6 +1265,7 @@ protected: std::shared_ptr m_spFakeBody_with_query_paramsResource; std::shared_ptr m_spFakeResource; std::shared_ptr m_spFakeInline_additionalPropertiesResource; + std::shared_ptr m_spFakeInline_freeform_additionalPropertiesResource; std::shared_ptr m_spFakeJsonFormDataResource; std::shared_ptr m_spFakeNullableResource; std::shared_ptr m_spFakeTest_query_parametersResource; diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/TestInlineFreeformAdditionalProperties_request.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/model/TestInlineFreeformAdditionalProperties_request.cpp new file mode 100644 index 00000000000..0bb87b05b29 --- /dev/null +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/TestInlineFreeformAdditionalProperties_request.cpp @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.1.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "TestInlineFreeformAdditionalProperties_request.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "helpers.h" + +using boost::property_tree::ptree; +using boost::property_tree::read_json; +using boost::property_tree::write_json; + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +TestInlineFreeformAdditionalProperties_request::TestInlineFreeformAdditionalProperties_request(boost::property_tree::ptree const& pt) +{ + fromPropertyTree(pt); +} + + +std::string TestInlineFreeformAdditionalProperties_request::toJsonString(bool prettyJson /* = false */) const +{ + std::stringstream ss; + write_json(ss, this->toPropertyTree(), prettyJson); + // workaround inspired by: https://stackoverflow.com/a/56395440 + std::regex reg("\\\"([0-9]+\\.{0,1}[0-9]*)\\\""); + std::string result = std::regex_replace(ss.str(), reg, "$1"); + return result; +} + +void TestInlineFreeformAdditionalProperties_request::fromJsonString(std::string const& jsonString) +{ + std::stringstream ss(jsonString); + ptree pt; + read_json(ss,pt); + this->fromPropertyTree(pt); +} + +ptree TestInlineFreeformAdditionalProperties_request::toPropertyTree() const +{ + ptree pt; + ptree tmp_node; + pt.put("someProperty", m_SomeProperty); + return pt; +} + +void TestInlineFreeformAdditionalProperties_request::fromPropertyTree(ptree const &pt) +{ + ptree tmp_node; + m_SomeProperty = pt.get("someProperty", ""); +} + +std::string TestInlineFreeformAdditionalProperties_request::getSomeProperty() const +{ + return m_SomeProperty; +} + +void TestInlineFreeformAdditionalProperties_request::setSomeProperty(std::string value) +{ + m_SomeProperty = value; +} + + + +std::vector createTestInlineFreeformAdditionalProperties_requestVectorFromJsonString(const std::string& json) +{ + std::stringstream sstream(json); + boost::property_tree::ptree pt; + boost::property_tree::json_parser::read_json(sstream,pt); + + auto vec = std::vector(); + for (const auto& child: pt) { + vec.emplace_back(TestInlineFreeformAdditionalProperties_request(child.second)); + } + + return vec; +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/TestInlineFreeformAdditionalProperties_request.h b/samples/server/petstore/cpp-restbed/generated/3_0/model/TestInlineFreeformAdditionalProperties_request.h new file mode 100644 index 00000000000..89fbf4f6d3f --- /dev/null +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/TestInlineFreeformAdditionalProperties_request.h @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.1.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * TestInlineFreeformAdditionalProperties_request.h + * + * + */ + +#ifndef TestInlineFreeformAdditionalProperties_request_H_ +#define TestInlineFreeformAdditionalProperties_request_H_ + + + +#include +#include +#include "AnyType.h" +#include +#include +#include +#include "helpers.h" + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +/// +/// +/// +class TestInlineFreeformAdditionalProperties_request +{ +public: + TestInlineFreeformAdditionalProperties_request() = default; + explicit TestInlineFreeformAdditionalProperties_request(boost::property_tree::ptree const& pt); + virtual ~TestInlineFreeformAdditionalProperties_request() = default; + + TestInlineFreeformAdditionalProperties_request(const TestInlineFreeformAdditionalProperties_request& other) = default; // copy constructor + TestInlineFreeformAdditionalProperties_request(TestInlineFreeformAdditionalProperties_request&& other) noexcept = default; // move constructor + + TestInlineFreeformAdditionalProperties_request& operator=(const TestInlineFreeformAdditionalProperties_request& other) = default; // copy assignment + TestInlineFreeformAdditionalProperties_request& operator=(TestInlineFreeformAdditionalProperties_request&& other) noexcept = default; // move assignment + + std::string toJsonString(bool prettyJson = false) const; + void fromJsonString(std::string const& jsonString); + boost::property_tree::ptree toPropertyTree() const; + void fromPropertyTree(boost::property_tree::ptree const& pt); + + + ///////////////////////////////////////////// + /// TestInlineFreeformAdditionalProperties_request members + + /// + /// + /// + std::string getSomeProperty() const; + void setSomeProperty(std::string value); + +protected: + std::string m_SomeProperty = ""; +}; + +std::vector createTestInlineFreeformAdditionalProperties_requestVectorFromJsonString(const std::string& json); + +template<> +inline boost::property_tree::ptree toPt(const TestInlineFreeformAdditionalProperties_request& val) { + return val.toPropertyTree(); +} + +template<> +inline TestInlineFreeformAdditionalProperties_request fromPt(const boost::property_tree::ptree& pt) { + TestInlineFreeformAdditionalProperties_request ret; + ret.fromPropertyTree(pt); + return ret; +} + +} +} +} +} + +#endif /* TestInlineFreeformAdditionalProperties_request_H_ */ diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES index 7fb08618a07..8c122ac92fd 100644 --- a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES @@ -65,6 +65,7 @@ src/main/java/org/openapitools/server/model/ReadOnlyFirst.java src/main/java/org/openapitools/server/model/SingleRefType.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java +src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/server/model/User.java src/main/java/org/openapitools/server/package-info.java src/main/resources/META-INF/beans.xml diff --git a/samples/server/petstore/java-helidon-server/mp/README.md b/samples/server/petstore/java-helidon-server/mp/README.md index 5fcf51dcd37..443dc6d1341 100644 --- a/samples/server/petstore/java-helidon-server/mp/README.md +++ b/samples/server/petstore/java-helidon-server/mp/README.md @@ -29,6 +29,7 @@ curl -X POST http://petstore.swagger.io:80/v2 curl -X GET http://petstore.swagger.io:80/v2 curl -X DELETE http://petstore.swagger.io:80/v2 curl -X POST http://petstore.swagger.io:80/v2/inline-additionalProperties +curl -X POST http://petstore.swagger.io:80/v2/inline-freeform-additionalProperties curl -X GET http://petstore.swagger.io:80/v2/jsonFormData curl -X POST http://petstore.swagger.io:80/v2/nullable curl -X PUT http://petstore.swagger.io:80/v2/test-query-parameters diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java index fdc92a3bb8d..856a23d38dc 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -27,6 +27,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; import org.openapitools.server.model.Pet; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.server.model.User; import jakarta.ws.rs.*; @@ -122,6 +123,11 @@ public interface FakeService { @Consumes({ "application/json" }) void testInlineAdditionalProperties(@Valid @NotNull Map requestBody); + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 74dae73bfa0..83412a6d0ea 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -27,6 +27,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; import org.openapitools.server.model.Pet; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.server.model.User; import jakarta.ws.rs.*; @@ -155,6 +156,12 @@ public class FakeServiceImpl implements FakeService { public void testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { } + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + public void testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + } + @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..abbeb6e6130 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + **/ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml index 59328fa022d..efc990069c1 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..55c3e0e12bb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES index 7202c2d2cdc..0a47bca3962 100644 --- a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES @@ -66,6 +66,7 @@ src/main/java/org/openapitools/server/model/ReadOnlyFirst.java src/main/java/org/openapitools/server/model/SingleRefType.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java +src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java src/main/java/org/openapitools/server/model/User.java src/main/java/org/openapitools/server/package-info.java src/main/resources/META-INF/openapi.yml diff --git a/samples/server/petstore/java-helidon-server/se/README.md b/samples/server/petstore/java-helidon-server/se/README.md index 3eda86a8663..182694aed7a 100644 --- a/samples/server/petstore/java-helidon-server/se/README.md +++ b/samples/server/petstore/java-helidon-server/se/README.md @@ -29,6 +29,7 @@ curl -X POST http://petstore.swagger.io:80/v2/fake curl -X GET http://petstore.swagger.io:80/v2/fake curl -X DELETE http://petstore.swagger.io:80/v2/fake curl -X POST http://petstore.swagger.io:80/v2/fake/inline-additionalProperties +curl -X POST http://petstore.swagger.io:80/v2/fake/inline-freeform-additionalProperties curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData curl -X POST http://petstore.swagger.io:80/v2/fake/nullable curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java index 16e4aa15e8b..5b20a7daaf8 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java @@ -17,6 +17,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; import org.openapitools.server.model.Pet; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.server.model.User; import io.helidon.webserver.Routing; @@ -48,6 +49,7 @@ public interface FakeService extends Service { rules.get("/fake", this::testEnumParameters); rules.delete("/fake", this::testGroupParameters); rules.post("/fake/inline-additionalProperties", this::testInlineAdditionalProperties); + rules.post("/fake/inline-freeform-additionalProperties", Handler.create(TestInlineFreeformAdditionalPropertiesRequest.class, this::testInlineFreeformAdditionalProperties)); rules.get("/fake/jsonFormData", this::testJsonFormData); rules.post("/fake/nullable", Handler.create(ChildWithNullable.class, this::testNullable)); rules.put("/fake/test-query-parameters", this::testQueryParameterCollectionFormat); @@ -172,6 +174,14 @@ public interface FakeService extends Service { */ void testInlineAdditionalProperties(ServerRequest request, ServerResponse response); + /** + * POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties. + * @param request the server request + * @param response the server response + * @param testInlineFreeformAdditionalPropertiesRequest request body + */ + void testInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + /** * GET /fake/jsonFormData : test json serialization of form data. * @param request the server request diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 11eb9fb2c68..bed72a65934 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -17,6 +17,7 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; import org.openapitools.server.model.Pet; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.server.model.User; import java.util.logging.Logger; @@ -94,6 +95,10 @@ public class FakeServiceImpl implements FakeService { response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } + public void testInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + public void testJsonFormData(ServerRequest request, ServerResponse response) { response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..ef5a7dabad7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Default constructor. + */ + public TestInlineFreeformAdditionalPropertiesRequest() { + // JSON-B / Jackson + } + + /** + * Create TestInlineFreeformAdditionalPropertiesRequest. + * + * @param someProperty someProperty + */ + public TestInlineFreeformAdditionalPropertiesRequest( + String someProperty + ) { + this.someProperty = someProperty; + } + + + + /** + * Get someProperty + * @return someProperty + */ + public String getSomeProperty() { + return someProperty; + } + + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml index 59328fa022d..efc990069c1 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -1031,6 +1031,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/nullable: post: description: "" @@ -2191,6 +2210,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..55c3e0e12bb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES index d76f1d408eb..8f13f005350 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES @@ -69,6 +69,7 @@ src/gen/java/org/openapitools/model/ReadOnlyFirst.java src/gen/java/org/openapitools/model/SingleRefType.java src/gen/java/org/openapitools/model/SpecialModelName.java src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java src/gen/java/org/openapitools/model/User.java src/main/java/org/openapitools/api/Bootstrap.java src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java 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 6ec67df2d1a..32c652a19ee 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 @@ -20,6 +20,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; import org.openapitools.model.Pet; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.model.User; import java.util.Map; @@ -269,6 +270,18 @@ public class FakeApi { throws NotFoundException { return delegate.testInlineAdditionalProperties(requestBody, securityContext); } + @javax.ws.rs.POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + + @io.swagger.annotations.ApiOperation(value = "test inline free-form additionalProperties", notes = "", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testInlineFreeformAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, securityContext); + } @javax.ws.rs.GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) 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 6675105bdc6..d42edf03a9a 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 @@ -18,6 +18,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; import org.openapitools.model.Pet; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.model.User; import java.util.List; @@ -46,6 +47,7 @@ public abstract class FakeApiService { public abstract Response testEnumParameters(List enumHeaderStringArray,String enumHeaderString,List enumQueryStringArray,String enumQueryString,Integer enumQueryInteger,Double enumQueryDouble,List enumQueryModelArray,List enumFormStringArray,String enumFormString,SecurityContext securityContext) throws NotFoundException; public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull 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 testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; public abstract Response testNullable(ChildWithNullable childWithNullable,SecurityContext securityContext) throws NotFoundException; public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, @NotNull String allowEmpty,Map language,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..1eccc22ee59 --- /dev/null +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,99 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @JsonProperty(value = "someProperty") + @ApiModelProperty(value = "") + + public String getSomeProperty() { + return someProperty; + } + + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return super.equals(o) && Objects.equals(someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), someProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + 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 8f60cba30a6..4490e6fe421 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.OuterObjectWithEnumProperty; import org.openapitools.model.Pet; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.model.User; import java.util.List; @@ -110,6 +111,11 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response testJsonFormData(String param, String param2, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/php-laravel/.openapi-generator/FILES b/samples/server/petstore/php-laravel/.openapi-generator/FILES index b962dea822e..25d212023fd 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/FILES +++ b/samples/server/petstore/php-laravel/.openapi-generator/FILES @@ -70,6 +70,7 @@ lib/app/Models/ReadOnlyFirst.php lib/app/Models/SingleRefType.php lib/app/Models/SpecialModelName.php lib/app/Models/Tag.php +lib/app/Models/TestInlineFreeformAdditionalPropertiesRequest.php lib/app/Models/User.php lib/app/Providers/AppServiceProvider.php lib/app/Providers/AuthServiceProvider.php diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index 486d313b45d..274d5c8d24c 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -397,6 +397,30 @@ class FakeController extends Controller return response('How about implementing testInlineAdditionalProperties as a post method ?'); } + /** + * Operation testInlineFreeformAdditionalProperties + * + * test inline free-form additionalProperties. + * + * + * @return Http response + */ + public function testInlineFreeformAdditionalProperties() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['testInlineFreeformAdditionalPropertiesRequest'])) { + throw new \InvalidArgumentException('Missing the required parameter $testInlineFreeformAdditionalPropertiesRequest when calling testInlineFreeformAdditionalProperties'); + } + $testInlineFreeformAdditionalPropertiesRequest = $input['testInlineFreeformAdditionalPropertiesRequest']; + + + return response('How about implementing testInlineFreeformAdditionalProperties as a post method ?'); + } /** * Operation testJsonFormData * diff --git a/samples/server/petstore/php-laravel/lib/app/Models/TestInlineFreeformAdditionalPropertiesRequest.php b/samples/server/petstore/php-laravel/lib/app/Models/TestInlineFreeformAdditionalPropertiesRequest.php new file mode 100644 index 00000000000..529b7ca27f0 --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Models/TestInlineFreeformAdditionalPropertiesRequest.php @@ -0,0 +1,15 @@ +get('/v2/fake/http-signature-test', 'FakeApi@fakeHttpSignatureTest'); */ $router->post('/v2/fake/inline-additionalProperties', 'FakeApi@testInlineAdditionalProperties'); +/** + * post testInlineFreeformAdditionalProperties + * Summary: test inline free-form additionalProperties + * Notes: + */ +$router->post('/v2/fake/inline-freeform-additionalProperties', 'FakeApi@testInlineFreeformAdditionalProperties'); + /** * get testJsonFormData * Summary: test json serialization of form data