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 637727ebbecd..6b687f96e18c 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 @@ -7358,7 +7358,20 @@ protected void addBodyModelSchema(CodegenParameter codegenParameter, String name } protected void updateRequestBodyForMap(CodegenParameter codegenParameter, Schema schema, String name, Set imports, String bodyParameterName) { - if (StringUtils.isNotBlank(name) && !(ModelUtils.isFreeFormObject(schema) && !ModelUtils.shouldGenerateFreeFormObjectModel(name, this))) { + boolean useModel = true; + if (StringUtils.isBlank(name)) { + useModel = false; + } else { + if (ModelUtils.isFreeFormObject(schema)) { + useModel = ModelUtils.shouldGenerateFreeFormObjectModel(name, this); + } else if (ModelUtils.isMapSchema(schema)) { + useModel = ModelUtils.shouldGenerateMapModel(schema); + } else if (ModelUtils.isArraySchema(schema)) { + useModel = ModelUtils.shouldGenerateArrayModel(schema); + } + } + + if (useModel) { this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true); } else { Schema inner = ModelUtils.getAdditionalProperties(schema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index b4ae0a7842f1..32e9ac61050b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -517,16 +517,13 @@ void generateModels(List files, List allModels, List unu continue; } } else if (ModelUtils.isMapSchema(schema)) { // check to see if it's a "map" model - // A composed schema (allOf, oneOf, anyOf) is considered a Map schema if the additionalproperties attribute is set - // for that composed schema. However, in the case of a composed schema, the properties are defined or referenced - // in the inner schemas, and the outer schema does not have properties. - if (!ModelUtils.isGenerateAliasAsModel(schema) && !ModelUtils.isComposedSchema(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty())) { + if (!ModelUtils.shouldGenerateMapModel(schema)) { // schema without property, i.e. alias to map LOGGER.info("Model {} not generated since it's an alias to map (without property) and `generateAliasAsModel` is set to false (default)", name); continue; } } else if (ModelUtils.isArraySchema(schema)) { // check to see if it's an "array" model - if (!ModelUtils.isGenerateAliasAsModel(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty())) { + if (!ModelUtils.shouldGenerateArrayModel(schema)) { // schema without property, i.e. alias to array LOGGER.info("Model {} not generated since it's an alias to array (without property) and `generateAliasAsModel` is set to false (default)", name); continue; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index ddf135549688..9b7787eda4e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -884,6 +884,17 @@ public static boolean shouldGenerateFreeFormObjectModel(String name, CodegenConf return unaliasedSchema.get$ref() != null; } + public static boolean shouldGenerateMapModel(Schema schema) { + // A composed schema (allOf, oneOf, anyOf) is considered a Map schema if the additionalproperties attribute is set + // for that composed schema. However, in the case of a composed schema, the properties are defined or referenced + // in the inner schemas, and the outer schema does not have properties. + return ModelUtils.isGenerateAliasAsModel(schema) || ModelUtils.isComposedSchema(schema) || !(schema.getProperties() == null || schema.getProperties().isEmpty()); + } + + public static boolean shouldGenerateArrayModel(Schema schema) { + return ModelUtils.isGenerateAliasAsModel(schema) || !(schema.getProperties() == null || schema.getProperties().isEmpty()); + } + /** * If a Schema contains a reference to another Schema with '$ref', returns the referenced Schema if it is found or the actual Schema in the other cases. * 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 fba2c981d82c..48b55285aa4b 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 @@ -978,6 +978,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1811,6 +1828,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 a238bd85bb29..faf7b6230cce 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 @@ -991,6 +991,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1942,6 +1959,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 2eaa3d1edf85..9ed104ab2839 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 @@ -963,6 +963,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1834,6 +1851,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 40e38cde7200..9d1dc1ee7167 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 @@ -961,6 +961,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1794,6 +1811,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 ba4f67cdbd83..c8a0413b061d 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 @@ -937,6 +937,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1912,6 +1929,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 29a142d7c42d..9da1b5781f9c 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 @@ -941,6 +941,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1774,6 +1791,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 182df263da30..20d0d1df7a9f 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 @@ -976,6 +976,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1785,6 +1802,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-echo.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-echo.yaml index 1ce0ac4c0273..dea319154236 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-echo.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-echo.yaml @@ -989,6 +989,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1793,6 +1810,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 fd0450ad2b93..b3727634f1bb 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 @@ -957,6 +957,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1759,6 +1776,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 3004706c6bae..28b35f470715 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 @@ -1012,6 +1012,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1841,6 +1858,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 3004706c6bae..28b35f470715 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 @@ -1012,6 +1012,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1841,6 +1858,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 56c2c88cd761..71e9f1525ed7 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 @@ -1012,6 +1012,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1865,6 +1882,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 c4cbbb00f4df..4fb684961ea4 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 @@ -942,6 +942,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1775,6 +1792,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 2e1dc575517c..09458a564d89 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 @@ -1064,6 +1064,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -2098,6 +2115,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string ObjectModelWithRefProps: description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations type: object 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 0aa6c1f795b4..0081123ded62 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 @@ -1000,6 +1000,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1982,6 +1999,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string 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 a0fafbbcbf47..9cdb45fcd65d 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 @@ -1048,6 +1048,23 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true /fake/inline-additionalProperties: post: tags: @@ -1904,6 +1921,11 @@ components: type: object description: A schema consisting only of additional properties additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string OuterEnum: nullable: true type: string diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md index 1670f76c1a89..acb3c3f5664f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md @@ -126,6 +126,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md index 1debc2b6564d..356154a4b991 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 ce37acaec65f..9d861a2ccf86 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 @@ -465,6 +465,26 @@ public interface IFakeApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestStringMapReference(Dictionary requestBody, int operationIndex = 0); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0); #endregion Synchronous Operations } @@ -967,6 +987,31 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3899,5 +3944,147 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestStringMapReference(Dictionary requestBody, int operationIndex = 0) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } 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 c03f1e44116a..1845b502818e 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 @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 2549af1e9846..8d7487593076 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 @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using UseSourceGeneration.Api; +using UseSourceGeneration.Client; +using UseSourceGeneration.Model; + +namespace Example +{ + public class TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 3d39a5b433d6..faf2c65bbe42 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 @@ -493,6 +493,29 @@ public interface IFakeApi : IApi /// Cancellation Token to cancel the request. /// <?> Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string? requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <?> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); } /// @@ -711,6 +734,18 @@ public interface ITestQueryParameterCollectionFormatApiResponse : UseSourceGener bool IsOk { get; } } + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : UseSourceGeneration.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// Represents a collection of functions to interact with the API endpoints /// @@ -1055,6 +1090,26 @@ internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception excepti { OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler? OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -4948,5 +5003,194 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + 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 OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + 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/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _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); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : UseSourceGeneration.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } } } 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 c03f1e44116a..1845b502818e 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 @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 a89b1cda5acd..94cf293ed111 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 @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 baaa01776963..d7f32767b505 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 @@ -493,6 +493,29 @@ public interface IFakeApi : IApi /// Cancellation Token to cancel the request. /// <?> Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string? requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <?> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); } /// @@ -711,6 +734,18 @@ public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPIToo bool IsOk { get; } } + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// Represents a collection of functions to interact with the API endpoints /// @@ -1055,6 +1090,26 @@ internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception excepti { OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler? OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -4948,5 +5003,194 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + 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 OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + 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/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _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); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } } } 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 c03f1e44116a..1845b502818e 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 @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 a89b1cda5acd..94cf293ed111 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 @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 c1c25a3577ec..4e476c366977 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 @@ -491,6 +491,29 @@ public interface IFakeApi : IApi /// Cancellation Token to cancel the request. /// <> Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); } /// @@ -709,6 +732,18 @@ public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPIToo bool IsOk { get; } } + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// Represents a collection of functions to interact with the API endpoints /// @@ -1053,6 +1088,26 @@ internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception excepti { OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -4946,5 +5001,194 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + 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 OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + 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/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _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); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } } } 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 c03f1e44116a..1845b502818e 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 @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 b5ba5edafdeb..46abf3716ffe 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 @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 b26a5d92d5d5..ee74e8e0603f 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 @@ -490,6 +490,29 @@ public interface IFakeApi : IApi /// Cancellation Token to cancel the request. /// <> Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); } /// @@ -708,6 +731,18 @@ public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPIToo bool IsOk { get; } } + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// Represents a collection of functions to interact with the API endpoints /// @@ -1052,6 +1087,26 @@ internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception excepti { OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -4936,5 +4991,194 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + 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 OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + 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/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _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); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new TestStringMapReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md index f41927be64a0..e5869d3ff7fa 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md @@ -151,6 +151,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md index ada65ec39650..754a08ec0278 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1640,3 +1641,92 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + 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 requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 57774764f56c..84983f84495e 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 @@ -431,6 +431,24 @@ public interface IFakeApiSync : IApiAccessor /// (optional) /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string)); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// + void TestStringMapReference(Dictionary requestBody); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody); #endregion Synchronous Operations } @@ -899,6 +917,29 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3427,5 +3468,118 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestStringMapReference(Dictionary requestBody) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + + 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 = requestBody; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + + + 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 = requestBody; + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/README.md b/samples/client/petstore/csharp/OpenAPIClient-net47/README.md index b77dcd24dfbf..d3de689dee76 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/README.md @@ -138,6 +138,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md index 1debc2b6564d..356154a4b991 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 ce37acaec65f..9d861a2ccf86 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 @@ -465,6 +465,26 @@ public interface IFakeApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestStringMapReference(Dictionary requestBody, int operationIndex = 0); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0); #endregion Synchronous Operations } @@ -967,6 +987,31 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3899,5 +3944,147 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestStringMapReference(Dictionary requestBody, int operationIndex = 0) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/README.md b/samples/client/petstore/csharp/OpenAPIClient-net48/README.md index b77dcd24dfbf..d3de689dee76 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/README.md @@ -138,6 +138,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md index 1debc2b6564d..356154a4b991 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 ce37acaec65f..9d861a2ccf86 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 @@ -465,6 +465,26 @@ public interface IFakeApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestStringMapReference(Dictionary requestBody, int operationIndex = 0); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0); #endregion Synchronous Operations } @@ -967,6 +987,31 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3899,5 +3944,147 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestStringMapReference(Dictionary requestBody, int operationIndex = 0) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md index b77dcd24dfbf..d3de689dee76 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md @@ -138,6 +138,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 b939df0baf1c..788c4017bba8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 785e887d37f9..78a5a735f098 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 @@ -465,6 +465,26 @@ public interface IFakeApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string? notRequiredNotNullable = default(string?), string? notRequiredNullable = default(string?), int operationIndex = 0); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestStringMapReference(Dictionary requestBody, int operationIndex = 0); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0); #endregion Synchronous Operations } @@ -967,6 +987,31 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string? notRequiredNotNullable = default(string?), string? notRequiredNullable = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3899,5 +3944,147 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestStringMapReference(Dictionary requestBody, int operationIndex = 0) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md index 06c969e72fed..5f07aabb84d6 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md @@ -112,6 +112,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md index 1debc2b6564d..356154a4b991 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 293a89f3b781..4f6ee8fad052 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 @@ -430,6 +430,24 @@ public interface IFakeApiSync : IApiAccessor /// (optional) /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string)); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// + void TestStringMapReference(Dictionary requestBody); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody); #endregion Synchronous Operations } @@ -898,6 +916,29 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3542,5 +3583,129 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestStringMapReference(Dictionary requestBody) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + + 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 = requestBody; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestStringMapReferenceWithHttpInfoAsync(requestBody, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + + + 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 = requestBody; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/stringMap-reference", 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("TestStringMapReference", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index 1670f76c1a89..acb3c3f5664f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -126,6 +126,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 1debc2b6564d..356154a4b991 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 ce37acaec65f..9d861a2ccf86 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 @@ -465,6 +465,26 @@ public interface IFakeApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestStringMapReference(Dictionary requestBody, int operationIndex = 0); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0); #endregion Synchronous Operations } @@ -967,6 +987,31 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = default(string), string notRequiredNullable = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3899,5 +3944,147 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestStringMapReference(Dictionary requestBody, int operationIndex = 0) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/README.md b/samples/client/petstore/csharp/OpenAPIClientCore/README.md index b77dcd24dfbf..d3de689dee76 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientCore/README.md @@ -138,6 +138,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml index c03f1e44116a..1845b502818e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml @@ -958,6 +958,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1889,6 +1906,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md index b939df0baf1c..788c4017bba8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientCore/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | # **FakeHealthGet** @@ -1572,3 +1573,88 @@ 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) + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### 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 TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.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) + 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 785e887d37f9..78a5a735f098 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 @@ -465,6 +465,26 @@ public interface IFakeApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TestQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string? notRequiredNotNullable = default(string?), string? notRequiredNullable = default(string?), int operationIndex = 0); + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + void TestStringMapReference(Dictionary requestBody, int operationIndex = 0); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0); #endregion Synchronous Operations } @@ -967,6 +987,31 @@ public interface IFakeApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string? notRequiredNotNullable = default(string?), string? notRequiredNullable = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test referenced string map + /// + /// + /// + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test referenced string map + /// + /// + /// + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -3899,5 +3944,147 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( return localVarResponse; } + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// + public void TestStringMapReference(Dictionary requestBody, int operationIndex = 0) + { + TestStringMapReferenceWithHttpInfo(requestBody); + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestStringMapReferenceWithHttpInfo(Dictionary requestBody, int operationIndex = 0) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/stringMap-reference", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// test referenced string map + /// + /// 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 TestStringMapReferenceAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await TestStringMapReferenceWithHttpInfoAsync(requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// test referenced string map + /// + /// 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> TestStringMapReferenceWithHttpInfoAsync(Dictionary requestBody, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestStringMapReference"); + } + + + 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 = requestBody; + + localVarRequestOptions.Operation = "FakeApi.TestStringMapReference"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/stringMap-reference", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestStringMapReference", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } 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 41fbe7a72904..dbf474c904b6 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -757,4 +757,35 @@ defmodule OpenapiPetstore.Api.Fake do {200, false} ]) end + + @doc """ + test referenced string map + + + ### Parameters + + - `connection` (OpenapiPetstore.Connection): Connection to server + - `request_body` (%{optional(String.t) => String.t}): request body + - `opts` (keyword): Optional parameters + + ### Returns + + - `{:ok, nil}` on success + - `{:error, Tesla.Env.t}` on failure + """ + @spec test_string_map_reference(Tesla.Env.client, %{optional(String.t) => String.t}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_string_map_reference(connection, request_body, _opts \\ []) do + request = + %{} + |> method(:post) + |> url("/fake/stringMap-reference") + |> add_param(:body, :body, request_body) + |> Enum.into([]) + + connection + |> Connection.request(request) + |> evaluate_response([ + {200, false} + ]) + end end 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 7e243e14b73c..4cdd475689dd 100644 --- a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -788,3 +789,38 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.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 | - | + 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 4c321d1cee84..717ed9436919 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 @@ -201,4 +201,13 @@ public interface FakeApi { @PUT @Path("/test-query-parameters") void testQueryParameterCollectionFormat(@QueryParam("pipe") List pipe, @QueryParam("ioutil") List ioutil, @QueryParam("http") List http, @QueryParam("url") List url, @QueryParam("context") List context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map language) throws ApiException, ProcessingException; + + /** + * test referenced string map + * + */ + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(Map requestBody) throws ApiException, ProcessingException; } 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 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md +++ b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 b3afad3461cd..429ada219289 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 @@ -172,4 +172,12 @@ public interface FakeApi { ApiResponse testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language); + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testStringMapReference(Map requestBody); + } 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 b8ff4b360056..8ea61f3eb2d8 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 @@ -81,6 +81,7 @@ public class FakeApiImpl implements FakeApi { 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); + protected static final GenericType RESPONSE_TYPE_testStringMapReference = ResponseType.create(Void.class); /** * Creates a new instance of FakeApiImpl initialized with the specified {@link ApiClient}. @@ -1039,4 +1040,42 @@ protected ApiResponse testQueryParameterCollectionFormatSubmit(WebClientRe return ApiResponse.create(RESPONSE_TYPE_testQueryParameterCollectionFormat, webClientResponse); } + @Override + public ApiResponse testStringMapReference(Map requestBody) { + Objects.requireNonNull(requestBody, "Required parameter 'requestBody' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testStringMapReferenceRequestBuilder(requestBody); + return testStringMapReferenceSubmit(webClientRequestBuilder, requestBody); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testStringMapReference operation. + * Optional customization point for subclasses. + * + * @param requestBody request body (required) + * @return WebClientRequestBuilder for testStringMapReference + */ + protected WebClientRequestBuilder testStringMapReferenceRequestBuilder(Map requestBody) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/stringMap-reference"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testStringMapReference operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param requestBody request body (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testStringMapReferenceSubmit(WebClientRequestBuilder webClientRequestBuilder, Map requestBody) { + Single webClientResponse = webClientRequestBuilder.submit(requestBody); + return ApiResponse.create(RESPONSE_TYPE_testStringMapReference, webClientResponse); + } + } diff --git a/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index 4e08e78fc162..6bd2b14e2954 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -129,6 +129,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 dfa04ecda4f4..f979fe92718f 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 @@ -1737,4 +1737,75 @@ public void testQueryParameterCollectionFormat(List pipe, List i ); } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testStringMapReference(Map requestBody) throws ApiException { + this.testStringMapReference(requestBody, Collections.emptyMap()); + } + + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testStringMapReference(Map requestBody, Map additionalHeaders) throws ApiException { + Object localVarPostBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + // create path and map variables + String localVarPath = "/fake/stringMap-reference"; + + 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 = { + + }; + 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 + ); + } + } diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 983e5ae93726..62bef602a5cd 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 @@ -1042,4 +1042,31 @@ public TestQueryParameterCollectionFormatQueryParams allowEmpty(final String val return this; } } + + /** + * test referenced string map + * + * @param requestBody request body (required) + */ + @RequestLine("POST /fake/stringMap-reference") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + void testStringMapReference(Map requestBody); + + /** + * test referenced string map + * Similar to testStringMapReference but it also returns the http response headers . + * + * @param requestBody request body (required) + */ + @RequestLine("POST /fake/stringMap-reference") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + ApiResponse testStringMapReferenceWithHttpInfo(Map requestBody); + + } diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 42cef0edc3ef..ffa85193e369 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -132,6 +132,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml index 8f79a7c4c5a8..07f944065424 100644 --- a/samples/client/petstore/java/jersey3/api/openapi.yaml +++ b/samples/client/petstore/java/jersey3/api/openapi.yaml @@ -956,6 +956,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1783,6 +1802,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/jersey3/docs/FakeApi.md b/samples/client/petstore/java/jersey3/docs/FakeApi.md index 55a9c935065e..567b5637ad2c 100644 --- a/samples/client/petstore/java/jersey3/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey3/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1195,3 +1196,67 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.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); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | **Map<String,String>**| 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 | - | + 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 9b965c9b57c4..65aa9fb92f3e 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 @@ -971,4 +971,43 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, null, null, false); } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testStringMapReference(Map requestBody) throws ApiException { + testStringMapReferenceWithHttpInfo(requestBody); + } + + /** + * test referenced string map + * + * @param requestBody 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 testStringMapReferenceWithHttpInfo(Map requestBody) throws ApiException { + // Check required parameters + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testStringMapReference", "/fake/stringMap-reference", "POST", new ArrayList<>(), requestBody, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); + } } diff --git a/samples/client/petstore/java/native-async/README.md b/samples/client/petstore/java/native-async/README.md index 0148d0b2d3c5..1f4122941718 100644 --- a/samples/client/petstore/java/native-async/README.md +++ b/samples/client/petstore/java/native-async/README.md @@ -146,6 +146,8 @@ Class | Method | HTTP request | Description *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 | *FakeApi* | [**testQueryParameterCollectionFormatWithHttpInfo**](docs/FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeApi* | [**testStringMapReferenceWithHttpInfo**](docs/FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *FakeClassnameTags123Api* | [**testClassnameWithHttpInfo**](docs/FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index 048456607eb6..4583b5bd0758 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -971,6 +971,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1798,6 +1817,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/native-async/docs/FakeApi.md b/samples/client/petstore/java/native-async/docs/FakeApi.md index cac951a5edc9..6e33a0c318bc 100644 --- a/samples/client/petstore/java/native-async/docs/FakeApi.md +++ b/samples/client/petstore/java/native-async/docs/FakeApi.md @@ -40,6 +40,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | | [**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | +| [**testStringMapReferenceWithHttpInfo**](FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map | @@ -2731,3 +2733,144 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> CompletableFuture testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + CompletableFuture result = apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testStringMapReferenceWithHttpInfo + +> CompletableFuture> testStringMapReference testStringMapReferenceWithHttpInfo(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + CompletableFuture> response = apiInstance.testStringMapReferenceWithHttpInfo(requestBody); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +CompletableFuture> + +### 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 | - | + 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 efd06759640b..7e2cc174ef8b 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 @@ -2020,4 +2020,87 @@ private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(Lis } return localVarRequestBuilder; } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return CompletableFuture<Void> + * @throws ApiException if fails to make API call + */ + public CompletableFuture testStringMapReference(Map requestBody) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testStringMapReferenceRequestBuilder(requestBody); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testStringMapReference", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testStringMapReferenceWithHttpInfo(Map requestBody) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testStringMapReferenceRequestBuilder(requestBody); + 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("testStringMapReference", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder testStringMapReferenceRequestBuilder(Map requestBody) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/stringMap-reference"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + 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; + } } diff --git a/samples/client/petstore/java/native/README.md b/samples/client/petstore/java/native/README.md index bafb85f35de1..b049f4cb52fc 100644 --- a/samples/client/petstore/java/native/README.md +++ b/samples/client/petstore/java/native/README.md @@ -145,6 +145,8 @@ Class | Method | HTTP request | Description *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 | *FakeApi* | [**testQueryParameterCollectionFormatWithHttpInfo**](docs/FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeApi* | [**testStringMapReferenceWithHttpInfo**](docs/FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *FakeClassnameTags123Api* | [**testClassnameWithHttpInfo**](docs/FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index 048456607eb6..4583b5bd0758 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -971,6 +971,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1798,6 +1817,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index adff98c08895..53b371caf118 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -40,6 +40,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data | | [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | | [**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | +| [**testStringMapReferenceWithHttpInfo**](FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map | @@ -2569,3 +2571,135 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +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 | - | + +## testStringMapReferenceWithHttpInfo + +> ApiResponse testStringMapReference testStringMapReferenceWithHttpInfo(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + ApiResponse response = apiInstance.testStringMapReferenceWithHttpInfo(requestBody); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +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 | - | + 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 4ae6a081cdc6..39dcdc2b1898 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 @@ -1820,4 +1820,84 @@ private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(Lis } return localVarRequestBuilder; } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testStringMapReference(Map requestBody) throws ApiException { + testStringMapReferenceWithHttpInfo(requestBody); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testStringMapReferenceWithHttpInfo(Map requestBody) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testStringMapReferenceRequestBuilder(requestBody); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testStringMapReference", 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 testStringMapReferenceRequestBuilder(Map requestBody) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/stringMap-reference"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + 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; + } } diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 8cd4a7430f5f..d4a7bc52e89a 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index a13b24e9e97d..dd043b231bed 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -952,6 +952,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1946,6 +1965,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 6af91003380e..d3f35fd2f2fe 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -22,6 +22,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1196,3 +1197,64 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +# **testStringMapReference** +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 35608948029c..b6d823e656d1 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 @@ -2602,4 +2602,122 @@ public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, L localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for testStringMapReference + * @param requestBody 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 testStringMapReferenceCall(Map requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/fake/stringMap-reference"; + + 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 testStringMapReferenceValidateBeforeCall(Map requestBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling testStringMapReference(Async)"); + } + + return testStringMapReferenceCall(requestBody, _callback); + + } + + /** + * test referenced string map + * + * @param requestBody 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 testStringMapReference(Map requestBody) throws ApiException { + testStringMapReferenceWithHttpInfo(requestBody); + } + + /** + * test referenced string map + * + * @param requestBody 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 testStringMapReferenceWithHttpInfo(Map requestBody) throws ApiException { + okhttp3.Call localVarCall = testStringMapReferenceValidateBeforeCall(requestBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * test referenced string map (asynchronously) + * + * @param requestBody 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 testStringMapReferenceAsync(Map requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testStringMapReferenceValidateBeforeCall(requestBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/samples/client/petstore/java/resteasy/README.md b/samples/client/petstore/java/resteasy/README.md index f436b871632f..aa591985e5bc 100644 --- a/samples/client/petstore/java/resteasy/README.md +++ b/samples/client/petstore/java/resteasy/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 cceced91b3a3..1c0ba7f61f96 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 @@ -1061,4 +1061,46 @@ public void testQueryParameterCollectionFormat(List pipe, List i apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testStringMapReference(Map requestBody) throws ApiException { + Object localVarPostBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + // create path and map variables + String localVarPath = "/fake/stringMap-reference".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + 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); + } } diff --git a/samples/client/petstore/java/resttemplate-withXml/README.md b/samples/client/petstore/java/resttemplate-withXml/README.md index 08a46fad4882..96c8678bca67 100644 --- a/samples/client/petstore/java/resttemplate-withXml/README.md +++ b/samples/client/petstore/java/resttemplate-withXml/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 88425e86cea1..5f74058a58d4 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 @@ -1197,4 +1197,49 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body (required) + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testStringMapReference(Map requestBody) throws RestClientException { + testStringMapReferenceWithHttpInfo(requestBody); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body (required) + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testStringMapReferenceWithHttpInfo(Map requestBody) throws RestClientException { + Object localVarPostBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + + 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/stringMap-reference", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } } diff --git a/samples/client/petstore/java/resttemplate/README.md b/samples/client/petstore/java/resttemplate/README.md index 046c1d47e35d..7352f30a1a1b 100644 --- a/samples/client/petstore/java/resttemplate/README.md +++ b/samples/client/petstore/java/resttemplate/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 88425e86cea1..5f74058a58d4 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 @@ -1197,4 +1197,49 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); } + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body (required) + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testStringMapReference(Map requestBody) throws RestClientException { + testStringMapReferenceWithHttpInfo(requestBody); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body (required) + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testStringMapReferenceWithHttpInfo(Map requestBody) throws RestClientException { + Object localVarPostBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + + 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/stringMap-reference", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } } diff --git a/samples/client/petstore/java/vertx/README.md b/samples/client/petstore/java/vertx/README.md index c022185a73c7..b748a0990d75 100644 --- a/samples/client/petstore/java/vertx/README.md +++ b/samples/client/petstore/java/vertx/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 8aec7cab4285..22cff7dd2e8a 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 e3717cf8f8c7..38e08fe4b8c2 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 @@ -108,4 +108,8 @@ public interface FakeApi { void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language, ApiClient.AuthInfo authInfo, Handler> handler); + void testStringMapReference(Map requestBody, Handler> handler); + + void testStringMapReference(Map requestBody, 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 c1375f95b403..4f6e2f184279 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 @@ -1206,6 +1206,54 @@ public void testQueryParameterCollectionFormat(List pipe, List i apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param resultHandler Asynchronous result handler + */ + public void testStringMapReference(Map requestBody, Handler> resultHandler) { + testStringMapReference(requestBody, null, resultHandler); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testStringMapReference(Map requestBody, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + Object localVarBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'requestBody' when calling testStringMapReference")); + return; + } + + // create path and map variables + String localVarPath = "/fake/stringMap-reference"; + + // 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); + } private String encodeParameter(String parameter) { try { 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 8980ce3c1afb..714d0587f736 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 @@ -1117,6 +1117,51 @@ public Single rxTestQueryParameterCollectionFormat(List pipe, List delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, authInfo, fut) )); } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param resultHandler Asynchronous result handler + */ + public void testStringMapReference(Map requestBody, Handler> resultHandler) { + delegate.testStringMapReference(requestBody, resultHandler); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testStringMapReference(Map requestBody, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testStringMapReference(requestBody, authInfo, resultHandler); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestStringMapReference(Map requestBody) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testStringMapReference(requestBody, fut) + )); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestStringMapReference(Map requestBody, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testStringMapReference(requestBody, authInfo, fut) + )); + } public static FakeApi newInstance(org.openapitools.client.api.FakeApi arg) { return arg != null ? new FakeApi(arg) : null; diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index 65b06fccc8de..6b86fac3fbff 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 7b435264e5ef..0818fac42a04 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 @@ -1780,4 +1780,73 @@ public Mono> testQueryParameterCollectionFormatWithHttpInfo public ResponseSpec testQueryParameterCollectionFormatWithResponseSpec(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language); } + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testStringMapReferenceRequestCreation(Map requestBody) throws WebClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new WebClientResponseException("Missing the required parameter 'requestBody' when calling testStringMapReference", 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/stringMap-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono testStringMapReference(Map requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testStringMapReferenceRequestCreation(requestBody).bodyToMono(localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> testStringMapReferenceWithHttpInfo(Map requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testStringMapReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testStringMapReferenceWithResponseSpec(Map requestBody) throws WebClientResponseException { + return testStringMapReferenceRequestCreation(requestBody); + } } diff --git a/samples/client/petstore/java/webclient-swagger2/README.md b/samples/client/petstore/java/webclient-swagger2/README.md index 65b06fccc8de..6b86fac3fbff 100644 --- a/samples/client/petstore/java/webclient-swagger2/README.md +++ b/samples/client/petstore/java/webclient-swagger2/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml b/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md b/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient-swagger2/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 3e209c2ff620..45edc4f38c01 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 @@ -1780,4 +1780,73 @@ public Mono> testQueryParameterCollectionFormatWithHttpInfo public ResponseSpec testQueryParameterCollectionFormatWithResponseSpec(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language); } + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testStringMapReferenceRequestCreation(Map requestBody) throws WebClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new WebClientResponseException("Missing the required parameter 'requestBody' when calling testStringMapReference", 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/stringMap-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono testStringMapReference(Map requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testStringMapReferenceRequestCreation(requestBody).bodyToMono(localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> testStringMapReferenceWithHttpInfo(Map requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testStringMapReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testStringMapReferenceWithResponseSpec(Map requestBody) throws WebClientResponseException { + return testStringMapReferenceRequestCreation(requestBody); + } } diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md index 65b06fccc8de..6b86fac3fbff 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -136,6 +136,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 4406a7347e04..c9073efd44cc 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 148fc7a22ddd..37a949ea0508 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1473,3 +1474,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +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 | - | + 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 3e209c2ff620..45edc4f38c01 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 @@ -1780,4 +1780,73 @@ public Mono> testQueryParameterCollectionFormatWithHttpInfo public ResponseSpec testQueryParameterCollectionFormatWithResponseSpec(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language); } + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testStringMapReferenceRequestCreation(Map requestBody) throws WebClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new WebClientResponseException("Missing the required parameter 'requestBody' when calling testStringMapReference", 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/stringMap-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono testStringMapReference(Map requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testStringMapReferenceRequestCreation(requestBody).bodyToMono(localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> testStringMapReferenceWithHttpInfo(Map requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return testStringMapReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced string map + * + *

200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testStringMapReferenceWithResponseSpec(Map requestBody) throws WebClientResponseException { + return testStringMapReferenceRequestCreation(requestBody); + } } diff --git a/samples/client/petstore/javascript-apollo/README.md b/samples/client/petstore/javascript-apollo/README.md index cc9221bf4653..0383642211cb 100644 --- a/samples/client/petstore/javascript-apollo/README.md +++ b/samples/client/petstore/javascript-apollo/README.md @@ -141,6 +141,7 @@ Class | Method | HTTP request | Description *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.FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-apollo/docs/FakeApi.md b/samples/client/petstore/javascript-apollo/docs/FakeApi.md index 140ff85a048d..02cc9e67cf79 100644 --- a/samples/client/petstore/javascript-apollo/docs/FakeApi.md +++ b/samples/client/petstore/javascript-apollo/docs/FakeApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map @@ -970,3 +971,48 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let requestBody = {key: "null"}; // {String: String} | request body +apiInstance.testStringMapReference(requestBody, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**{String: String}**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-apollo/src/api/FakeApi.js b/samples/client/petstore/javascript-apollo/src/api/FakeApi.js index 1699e697ffaa..9a542a4cb8db 100644 --- a/samples/client/petstore/javascript-apollo/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-apollo/src/api/FakeApi.js @@ -831,5 +831,41 @@ export default class FakeApi extends ApiClient { ); } + /** + * test referenced string map + * + * @param {Object.} requestBody request body + * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} + * @return {Promise} + */ + async testStringMapReference(requestBody, requestInit) { + let postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody === undefined || requestBody === null) { + throw new Error("Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + 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/stringMap-reference', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, requestInit + ); + } + } diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 8b628d8ea909..7a324ed52217 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -141,6 +141,7 @@ Class | Method | HTTP request | Description *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.FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index 6ed67beb69f7..e8b03a16bb3b 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map @@ -970,3 +971,48 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let requestBody = {key: "null"}; // {String: String} | request body +apiInstance.testStringMapReference(requestBody, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**{String: String}**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index c47f7247b7b3..f11f7f4da115 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -934,5 +934,46 @@ export default class FakeApi { ); } + /** + * Callback function to receive the result of the testStringMapReference operation. + * @callback module:api/FakeApi~testStringMapReferenceCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * test referenced string map + * + * @param {Object.} requestBody request body + * @param {module:api/FakeApi~testStringMapReferenceCallback} callback The callback function, accepting three arguments: error, data, response + */ + testStringMapReference(requestBody, callback) { + let postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody === undefined || requestBody === null) { + throw new Error("Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/fake/stringMap-reference', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + } diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index b538c6edc33c..c3cfc1ed5f88 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -139,6 +139,7 @@ Class | Method | HTTP request | Description *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.FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index c04cb9b9057f..35eefd239021 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -23,6 +23,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map @@ -951,3 +952,47 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let requestBody = {key: "null"}; // {String: String} | request body +apiInstance.testStringMapReference(requestBody).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**{String: String}**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + 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 67f8f1b2d286..13b37ed3dc7c 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -1074,4 +1074,51 @@ export default class FakeApi { } + /** + * test referenced string map + * + * @param {Object.} requestBody request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + testStringMapReferenceWithHttpInfo(requestBody) { + let postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody === undefined || requestBody === null) { + throw new Error("Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/fake/stringMap-reference', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * test referenced string map + * + * @param {Object.} requestBody request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + testStringMapReference(requestBody) { + return this.testStringMapReferenceWithHttpInfo(requestBody) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + } diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index d2f55a29daec..d45b5c0ba719 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -262,6 +262,20 @@ export default function() { } }); + group("/fake/stringMap-reference", () => { + + // Request No. 1: testStringMapReference + { + let url = BASE_URL + `/fake/stringMap-reference`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/fake/outer/composite", () => { // Request No. 1: fakeOuterCompositeSerialize diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 3443b82fdee4..7f6153b054df 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -419,6 +419,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 440d7f0e5506..498e93cced7b 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map # **fake_big_decimal_map** @@ -1054,3 +1055,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) +# **test_string_map_reference** +> test_string_map_reference(request_body => $request_body) + +test referenced string map + + + +### Example +```perl +use Data::Dumper; +use WWW::OpenAPIClient::FakeApi; +my $api_instance = WWW::OpenAPIClient::FakeApi->new( +); + +my $request_body = WWW::OpenAPIClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body + +eval { + $api_instance->test_string_map_reference(request_body => $request_body); +}; +if ($@) { + warn "Exception when calling FakeApi->test_string_map_reference: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**HASH[string,string]**](string.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) + diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index d2a79db97cf4..1838f4d84597 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -1756,4 +1756,65 @@ sub test_query_parameter_collection_format { return; } +# +# test_string_map_reference +# +# test referenced string map +# +# @param HASH[string,string] $request_body request body (required) +{ + my $params = { + 'request_body' => { + data_type => 'HASH[string,string]', + description => 'request body', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ 'test_string_map_reference' } = { + summary => 'test referenced string map', + params => $params, + returns => undef, + }; +} +# @return void +# +sub test_string_map_reference { + my ($self, %args) = @_; + + # verify the required parameter 'request_body' is set + unless (exists $args{'request_body'}) { + croak("Missing the required parameter 'request_body' when calling test_string_map_reference"); + } + + # parse inputs + my $_resource_path = '/fake/stringMap-reference'; + + 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{'request_body'}) { + $_body_data = $args{'request_body'}; + } + + # 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; +} + 1; diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md b/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md index 1f0bcb99bbb5..d5e387284cad 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/README.md @@ -94,6 +94,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/Api/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 48800159f242..39ac3ed2a67b 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 @@ -25,6 +25,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati | [**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 | | +| [**testStringMapReference()**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | ## `fakeBigDecimalMap()` @@ -1266,3 +1267,58 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `testStringMapReference()` + +```php +testStringMapReference($request_body) +``` + +test referenced string map + + + +### Example + +```php + 'request_body_example'); // array | request body + +try { + $apiInstance->testStringMapReference($request_body); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testStringMapReference: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **request_body** | [**array**](../Model/string.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) 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 5adb962d1701..120cbb97a055 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 @@ -135,6 +135,9 @@ class FakeApi 'testQueryParameterCollectionFormat' => [ 'application/json', ], + 'testStringMapReference' => [ + 'application/json', + ], ]; /** @@ -6485,6 +6488,249 @@ public function testQueryParameterCollectionFormatRequest( ); } + /** + * Operation testStringMapReference + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return void + */ + public function testStringMapReference( + array $request_body, + string $contentType = self::contentTypes['testStringMapReference'][0] + ): void + { + $this->testStringMapReferenceWithHttpInfo($request_body, $contentType); + } + + /** + * Operation testStringMapReferenceWithHttpInfo + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testStringMapReferenceWithHttpInfo( + array $request_body, + string $contentType = self::contentTypes['testStringMapReference'][0] + ): array + { + $request = $this->testStringMapReferenceRequest($request_body, $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 testStringMapReferenceAsync + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function testStringMapReferenceAsync( + array $request_body, + string $contentType = self::contentTypes['testStringMapReference'][0] + ): PromiseInterface + { + return $this->testStringMapReferenceAsyncWithHttpInfo($request_body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testStringMapReferenceAsyncWithHttpInfo + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return PromiseInterface + */ + public function testStringMapReferenceAsyncWithHttpInfo( + $request_body, + string $contentType = self::contentTypes['testStringMapReference'][0] + ): PromiseInterface + { + $returnType = ''; + $request = $this->testStringMapReferenceRequest($request_body, $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 'testStringMapReference' + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function testStringMapReferenceRequest( + $request_body, + string $contentType = self::contentTypes['testStringMapReference'][0] + ): Request + { + + // verify the required parameter 'request_body' is set + if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $request_body when calling testStringMapReference' + ); + } + + + $resourcePath = '/fake/stringMap-reference'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($request_body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 + ); + } + /** * Create http client option * diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 91218feed664..3255327db3a4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -95,6 +95,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/Api/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 7c84b0c17d51..92da9fdf9929 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to http://petstore.swagger.io:80/v2, except if the operati | [**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 | | +| [**testStringMapReference()**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | ## `fakeBigDecimalMap()` @@ -1272,3 +1273,58 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `testStringMapReference()` + +```php +testStringMapReference($request_body) +``` + +test referenced string map + + + +### Example + +```php + 'request_body_example'); // array | request body + +try { + $apiInstance->testStringMapReference($request_body); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testStringMapReference: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **request_body** | [**array**](../Model/string.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) 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 f4cf34537d80..2b81767f3507 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -135,6 +135,9 @@ class FakeApi 'testQueryParameterCollectionFormat' => [ 'application/json', ], + 'testStringMapReference' => [ + 'application/json', + ], ]; /** @@ -6101,6 +6104,234 @@ public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, ); } + /** + * Operation testStringMapReference + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function testStringMapReference($request_body, string $contentType = self::contentTypes['testStringMapReference'][0]) + { + $this->testStringMapReferenceWithHttpInfo($request_body, $contentType); + } + + /** + * Operation testStringMapReferenceWithHttpInfo + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testStringMapReferenceWithHttpInfo($request_body, string $contentType = self::contentTypes['testStringMapReference'][0]) + { + $request = $this->testStringMapReferenceRequest($request_body, $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 testStringMapReferenceAsync + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testStringMapReferenceAsync($request_body, string $contentType = self::contentTypes['testStringMapReference'][0]) + { + return $this->testStringMapReferenceAsyncWithHttpInfo($request_body, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testStringMapReferenceAsyncWithHttpInfo + * + * test referenced string map + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testStringMapReferenceAsyncWithHttpInfo($request_body, string $contentType = self::contentTypes['testStringMapReference'][0]) + { + $returnType = ''; + $request = $this->testStringMapReferenceRequest($request_body, $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 'testStringMapReference' + * + * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testStringMapReference'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function testStringMapReferenceRequest($request_body, string $contentType = self::contentTypes['testStringMapReference'][0]) + { + + // verify the required parameter 'request_body' is set + if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request_body when calling testStringMapReference' + ); + } + + + $resourcePath = '/fake/stringMap-reference'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($request_body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 + ); + } + /** * Create http client option * diff --git a/samples/client/petstore/php/psr-18/README.md b/samples/client/petstore/php/psr-18/README.md index f386b2788bf8..0461c7e669d9 100644 --- a/samples/client/petstore/php/psr-18/README.md +++ b/samples/client/petstore/php/psr-18/README.md @@ -106,6 +106,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/Api/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 db072f39718f..8b2abf751607 100644 --- a/samples/client/petstore/php/psr-18/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/psr-18/docs/Api/FakeApi.md @@ -25,6 +25,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference()**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map ## `fakeBigDecimalMap()` @@ -1269,3 +1270,58 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `testStringMapReference()` + +```php +testStringMapReference($request_body) +``` + +test referenced string map + + + +### Example + +```php + 'request_body_example'); // array | request body + +try { + $apiInstance->testStringMapReference($request_body); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testStringMapReference: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**array**](../Model/string.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) 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 55c4bcd24629..48aaa3c7c020 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php @@ -5493,6 +5493,218 @@ public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, return $this->createRequest('PUT', $uri, $headers, $httpBody); } + /** + * Operation testStringMapReference + * + * test referenced string map + * + * @param array $request_body request body (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testStringMapReference($request_body) + { + $this->testStringMapReferenceWithHttpInfo($request_body); + } + + /** + * Operation testStringMapReferenceWithHttpInfo + * + * test referenced string map + * + * @param array $request_body 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 testStringMapReferenceWithHttpInfo($request_body) + { + $request = $this->testStringMapReferenceRequest($request_body); + + 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 testStringMapReferenceAsync + * + * test referenced string map + * + * @param array $request_body request body (required) + * + * @throws \InvalidArgumentException + * @return Promise + */ + public function testStringMapReferenceAsync($request_body) + { + return $this->testStringMapReferenceAsyncWithHttpInfo($request_body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testStringMapReferenceAsyncWithHttpInfo + * + * test referenced string map + * + * @param array $request_body request body (required) + * + * @throws \InvalidArgumentException + * @return Promise + */ + public function testStringMapReferenceAsyncWithHttpInfo($request_body) + { + $returnType = ''; + $request = $this->testStringMapReferenceRequest($request_body); + + 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 'testStringMapReference' + * + * @param array $request_body request body (required) + * + * @throws \InvalidArgumentException + * @return RequestInterface + */ + public function testStringMapReferenceRequest($request_body) + { + // verify the required parameter 'request_body' is set + if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request_body when calling testStringMapReference' + ); + } + + $resourcePath = '/fake/stringMap-reference'; + $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($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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); + } + /** * @param string $method diff --git a/samples/client/petstore/powershell/README.md b/samples/client/petstore/powershell/README.md index d2cc11fce52b..f9533ead70eb 100644 --- a/samples/client/petstore/powershell/README.md +++ b/samples/client/petstore/powershell/README.md @@ -74,6 +74,7 @@ Class | Method | HTTP request | Description *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 | +*PSFakeApi* | [**Test-PSStringMapReference**](docs/PSFakeApi.md#Test-PSStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *PSFakeClassnameTags123Api* | [**Test-PSClassname**](docs/PSFakeClassnameTags123Api.md#Test-PSClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PSPetApi* | [**Add-PSPet**](docs/PSPetApi.md#Add-PSPet) | **POST** /pet | Add a new pet to the store *PSPetApi* | [**Remove-Pet**](docs/PSPetApi.md#remove-pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/powershell/docs/PSFakeApi.md b/samples/client/petstore/powershell/docs/PSFakeApi.md index 7b199fd9e021..2fbbcd7e7436 100644 --- a/samples/client/petstore/powershell/docs/PSFakeApi.md +++ b/samples/client/petstore/powershell/docs/PSFakeApi.md @@ -21,6 +21,7 @@ Method | HTTP request | Description [**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 | +[**Test-PSStringMapReference**](PSFakeApi.md#Test-PSStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map @@ -834,3 +835,46 @@ 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-PSStringMapReference** +> void Test-PSStringMapReference
+>         [-RequestBody]
+ +test referenced string map + + + +### Example +```powershell +$RequestBody = @{ key_example = "MyInner" } # System.Collections.Hashtable | request body + +# test referenced string map +try { + $Result = Test-PSStringMapReference -RequestBody $RequestBody +} catch { + Write-Host ("Exception occurred when calling Test-PSStringMapReference: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **RequestBody** | [**System.Collections.Hashtable**](String.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) + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 index c68a87293dff..87f58e94686f 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 @@ -1584,3 +1584,78 @@ function Test-PSQueryParameterCollectionFormat { } } +<# +.SYNOPSIS + +test referenced string map + +.DESCRIPTION + +No description available. + +.PARAMETER RequestBody +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-PSStringMapReference { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Collections.Hashtable] + ${RequestBody}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSStringMapReference' | 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/stringMap-reference' + + if (!$RequestBody) { + throw "Error! The required parameter `RequestBody` missing when calling testStringMapReference." + } + + $LocalVarBodyParameter = $RequestBody | 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"] + } + } +} + diff --git a/samples/client/petstore/ruby-autoload/README.md b/samples/client/petstore/ruby-autoload/README.md index 8556b62fc360..3d73717ead71 100644 --- a/samples/client/petstore/ruby-autoload/README.md +++ b/samples/client/petstore/ruby-autoload/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *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 | +*Petstore::FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby-autoload/docs/FakeApi.md b/samples/client/petstore/ruby-autoload/docs/FakeApi.md index bb3486f585a4..4262104d12af 100644 --- a/samples/client/petstore/ruby-autoload/docs/FakeApi.md +++ b/samples/client/petstore/ruby-autoload/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map | ## fake_big_decimal_map @@ -1449,3 +1450,66 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## test_string_map_reference + +> test_string_map_reference(request_body) + +test referenced string map + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +request_body = { key: 'inner_example'} # Hash | request body + +begin + # test referenced string map + api_instance.test_string_map_reference(request_body) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference: #{e}" +end +``` + +#### Using the test_string_map_reference_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_string_map_reference_with_http_info(request_body) + +```ruby +begin + # test referenced string map + data, status_code, headers = api_instance.test_string_map_reference_with_http_info(request_body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_body** | [**Hash<String, String>**](String.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + 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 68efaa01be7c..e49ae1f663c7 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 @@ -1589,5 +1589,71 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur end return data, status_code, headers end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_string_map_reference(request_body, opts = {}) + test_string_map_reference_with_http_info(request_body, opts) + nil + end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_string_map_reference_with_http_info(request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_string_map_reference ...' + end + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_string_map_reference" + end + # resource path + local_var_path = '/fake/stringMap-reference' + + # 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(request_body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_string_map_reference", + :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_string_map_reference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 8556b62fc360..3d73717ead71 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *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 | +*Petstore::FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index bb3486f585a4..4262104d12af 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map | ## fake_big_decimal_map @@ -1449,3 +1450,66 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## test_string_map_reference + +> test_string_map_reference(request_body) + +test referenced string map + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +request_body = { key: 'inner_example'} # Hash | request body + +begin + # test referenced string map + api_instance.test_string_map_reference(request_body) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference: #{e}" +end +``` + +#### Using the test_string_map_reference_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_string_map_reference_with_http_info(request_body) + +```ruby +begin + # test referenced string map + data, status_code, headers = api_instance.test_string_map_reference_with_http_info(request_body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_body** | [**Hash<String, String>**](String.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + 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 68efaa01be7c..e49ae1f663c7 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 @@ -1589,5 +1589,71 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur end return data, status_code, headers end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_string_map_reference(request_body, opts = {}) + test_string_map_reference_with_http_info(request_body, opts) + nil + end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_string_map_reference_with_http_info(request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_string_map_reference ...' + end + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_string_map_reference" + end + # resource path + local_var_path = '/fake/stringMap-reference' + + # 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(request_body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_string_map_reference", + :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_string_map_reference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/client/petstore/ruby-httpx/README.md b/samples/client/petstore/ruby-httpx/README.md index daa2a6d5b0fa..9649f004c8ca 100644 --- a/samples/client/petstore/ruby-httpx/README.md +++ b/samples/client/petstore/ruby-httpx/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *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::FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby-httpx/docs/FakeApi.md b/samples/client/petstore/ruby-httpx/docs/FakeApi.md index b61148721ca3..1e05788c53ab 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map | ## fake_big_decimal_map @@ -1453,3 +1454,66 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## test_string_map_reference + +> test_string_map_reference(request_body) + +test referenced string map + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +request_body = { key: 'inner_example'} # Hash | request body + +begin + # test referenced string map + api_instance.test_string_map_reference(request_body) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference: #{e}" +end +``` + +#### Using the test_string_map_reference_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_string_map_reference_with_http_info(request_body) + +```ruby +begin + # test referenced string map + data, status_code, headers = api_instance.test_string_map_reference_with_http_info(request_body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_body** | [**Hash<String, String>**](String.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb index 064496fe435c..9886d4f78612 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb @@ -1604,5 +1604,71 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur end return data, status_code, headers end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_string_map_reference(request_body, opts = {}) + test_string_map_reference_with_http_info(request_body, opts) + nil + end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_string_map_reference_with_http_info(request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_string_map_reference ...' + end + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_string_map_reference" + end + # resource path + local_var_path = '/fake/stringMap-reference' + + # 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(request_body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_string_map_reference", + :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_string_map_reference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index daa2a6d5b0fa..9649f004c8ca 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *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::FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index f3594ca3fb9b..1dff682f9a2d 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -25,6 +25,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map | ## fake_big_decimal_map @@ -1453,3 +1454,66 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined + +## test_string_map_reference + +> test_string_map_reference(request_body) + +test referenced string map + + + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +request_body = { key: 'inner_example'} # Hash | request body + +begin + # test referenced string map + api_instance.test_string_map_reference(request_body) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference: #{e}" +end +``` + +#### Using the test_string_map_reference_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> test_string_map_reference_with_http_info(request_body) + +```ruby +begin + # test referenced string map + data, status_code, headers = api_instance.test_string_map_reference_with_http_info(request_body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->test_string_map_reference_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_body** | [**Hash<String, String>**](String.md) | request body | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + 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 b26b4b239433..04409a448440 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1604,5 +1604,71 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur end return data, status_code, headers end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_string_map_reference(request_body, opts = {}) + test_string_map_reference_with_http_info(request_body, opts) + nil + end + + # test referenced string map + # + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_string_map_reference_with_http_info(request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_string_map_reference ...' + end + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_string_map_reference" + end + # resource path + local_var_path = '/fake/stringMap-reference' + + # 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(request_body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.test_string_map_reference", + :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_string_map_reference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + 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 ae1bcb369e7e..2d0cef8918e8 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts @@ -2694,6 +2694,42 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testStringMapReference: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'requestBody' is not null or undefined + assertParamExists('testStringMapReference', 'requestBody', requestBody) + const localVarPath = `/fake/stringMap-reference`; + // 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(requestBody, localVarRequestOptions, configuration) + return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, @@ -2952,6 +2988,19 @@ export const FakeApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['FakeApi.testQueryParameterCollectionFormat']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.testStringMapReference(requestBody, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = operationServerMap['FakeApi.testStringMapReference']?.[index]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); + }, } }; @@ -3154,6 +3203,16 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: any): AxiosPromise { return localVarFp.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testStringMapReference(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { + return localVarFp.testStringMapReference(requestBody, options).then((request) => request(axios, basePath)); + }, }; }; @@ -3389,6 +3448,18 @@ export class FakeApi extends BaseAPI { public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, options).then((request) => request(this.axios, this.basePath)); } + + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FakeApi + */ + public testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) { + return FakeApiFp(this.configuration).testStringMapReference(requestBody, options).then((request) => request(this.axios, this.basePath)); + } } /** 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 ea8870c4106c..e8a38fc993d3 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 @@ -2323,6 +2323,42 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testStringMapReference: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'requestBody' is not null or undefined + assertParamExists('testStringMapReference', 'requestBody', requestBody) + const localVarPath = `/fake/stringMap-reference`; + // 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(requestBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * To test unique items in header and query parameters * @param {Set} queryUnique @@ -2608,6 +2644,19 @@ export const FakeApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['FakeApi.testQueryParameterCollectionFormat']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.testStringMapReference(requestBody, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = operationServerMap['FakeApi.testStringMapReference']?.[index]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); + }, /** * To test unique items in header and query parameters * @param {Set} queryUnique @@ -2814,6 +2863,16 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: any): AxiosPromise { return localVarFp.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + testStringMapReference(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { + return localVarFp.testStringMapReference(requestBody, options).then((request) => request(axios, basePath)); + }, /** * To test unique items in header and query parameters * @param {Set} queryUnique @@ -3049,6 +3108,18 @@ export class FakeApi extends BaseAPI { return FakeApiFp(this.configuration).testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary test referenced string map + * @param {{ [key: string]: string; }} requestBody request body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FakeApi + */ + public testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) { + return FakeApiFp(this.configuration).testStringMapReference(requestBody, options).then((request) => request(this.axios, this.basePath)); + } + /** * To test unique items in header and query parameters * @param {Set} queryUnique 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 974f7a5ded79..7d5dc1d02760 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 @@ -164,6 +164,10 @@ export interface TestQueryParameterCollectionFormatRequest { language?: { [key: string]: string; }; } +export interface TestStringMapReferenceRequest { + requestBody: { [key: string]: string; }; +} + /** * */ @@ -1098,6 +1102,40 @@ export class FakeApi extends runtime.BaseAPI { await this.testQueryParameterCollectionFormatRaw(requestParameters, initOverrides); } + /** + * + * test referenced string map + */ + async testStringMapReferenceRaw(requestParameters: TestStringMapReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.requestBody === null || requestParameters.requestBody === undefined) { + throw new runtime.RequiredError('requestBody','Required parameter requestParameters.requestBody was null or undefined when calling testStringMapReference.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/fake/stringMap-reference`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.requestBody, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test referenced string map + */ + async testStringMapReference(requestParameters: TestStringMapReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testStringMapReferenceRaw(requestParameters, initOverrides); + } + } /** 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 026fcf4caea3..0926e0593993 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 @@ -88,6 +88,7 @@ Class | Method | HTTP request | Description [*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 | +[*FakeApi*](doc/FakeApi.md) | [**testStringMapReference**](doc/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map [*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case [*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store [*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 d3921e831aad..1b5e1ca297c8 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 @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map # **fakeBigDecimalMap** @@ -983,3 +984,45 @@ 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) +# **testStringMapReference** +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = ; // Map | request body + +try { + api.testStringMapReference(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testStringMapReference: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.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) + 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 01709c06c5b3..06486358eda5 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 @@ -1644,4 +1644,69 @@ _bodyData=jsonEncode(childWithNullable); return _response; } + /// test referenced string map + /// + /// + /// Parameters: + /// * [requestBody] - 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> testStringMapReference({ + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/stringMap-reference'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(requestBody); + } 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; + } + } 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 b1810ac23cfb..0139e029edfd 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 @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description [*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 | +[*FakeApi*](doc/FakeApi.md) | [**testStringMapReference**](doc/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map [*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case [*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store [*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 70492f2658ca..d9ba061a46e0 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 @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map # **fakeBigDecimalMap** @@ -983,3 +984,45 @@ 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) +# **testStringMapReference** +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final BuiltMap requestBody = ; // BuiltMap | request body + +try { + api.testStringMapReference(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testStringMapReference: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**BuiltMap<String, String>**](String.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) + 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 ff1fe20d363f..54282514f27b 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 @@ -1720,4 +1720,71 @@ class FakeApi { return _response; } + /// test referenced string map + /// + /// + /// Parameters: + /// * [requestBody] - 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> testStringMapReference({ + required BuiltMap requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/stringMap-reference'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(BuiltMap, [FullType(String), FullType(String)]); + _bodyData = _serializers.serialize(requestBody, 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; + } + } 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 9fd780b4e214..d8540e6798e6 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 @@ -81,6 +81,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](doc//FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](doc//FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 f20a9ec06422..e5c71555c9a8 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 @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map # **fakeBigDecimalMap** @@ -989,3 +990,45 @@ 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) +# **testStringMapReference** +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api_instance = FakeApi(); +final requestBody = Map(); // Map | request body + +try { + api_instance.testStringMapReference(requestBody); +} catch (e) { + print('Exception when calling FakeApi->testStringMapReference: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map**](String.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) + 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 207fc6ddaf93..fa92d599b01b 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 @@ -1358,4 +1358,54 @@ class FakeApi { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } + + /// test referenced string map + /// + /// + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [Map] requestBody (required): + /// request body + Future testStringMapReferenceWithHttpInfo(Map requestBody,) async { + // ignore: prefer_const_declarations + final path = r'/fake/stringMap-reference'; + + // ignore: prefer_final_locals + Object? postBody = requestBody; + + 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 referenced string map + /// + /// + /// + /// Parameters: + /// + /// * [Map] requestBody (required): + /// request body + Future testStringMapReference(Map requestBody,) async { + final response = await testStringMapReferenceWithHttpInfo(requestBody,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 824b9c75795d..dc528cb906dc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *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 | +*FakeAPI* | [**TestStringMapReference**](docs/FakeAPI.md#teststringmapreference) | **Post** /fake/stringMap-reference | test referenced string map *FakeAPI* | [**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](docs/FakeAPI.md#testuniqueitemsheaderandqueryparametercollectionformat) | **Put** /fake/test-unique-parameters | *FakeClassnameTags123API* | [**TestClassname**](docs/FakeClassnameTags123API.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *PetAPI* | [**AddPet**](docs/PetAPI.md#addpet) | **Post** /pet | Add a new pet to the store 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 1fb3d0d490e9..426ad28a116e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -923,6 +923,23 @@ paths: summary: test referenced additionalProperties tags: - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake /fake/inline-additionalProperties: post: description: "" @@ -1805,6 +1822,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 afb4a610251f..34dd452ac023 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -260,6 +260,19 @@ type FakeAPI interface { // TestQueryParameterCollectionFormatExecute executes the request TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*http.Response, error) + /* + TestStringMapReference test referenced string map + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestStringMapReferenceRequest + */ + TestStringMapReference(ctx context.Context) ApiTestStringMapReferenceRequest + + // TestStringMapReferenceExecute executes the request + TestStringMapReferenceExecute(r ApiTestStringMapReferenceRequest) (*http.Response, error) + /* TestUniqueItemsHeaderAndQueryParameterCollectionFormat Method for TestUniqueItemsHeaderAndQueryParameterCollectionFormat @@ -2526,6 +2539,106 @@ func (a *FakeAPIService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer return localVarHTTPResponse, nil } +type ApiTestStringMapReferenceRequest struct { + ctx context.Context + ApiService FakeAPI + requestBody *map[string]string +} + +// request body +func (r ApiTestStringMapReferenceRequest) RequestBody(requestBody map[string]string) ApiTestStringMapReferenceRequest { + r.requestBody = &requestBody + return r +} + +func (r ApiTestStringMapReferenceRequest) Execute() (*http.Response, error) { + return r.ApiService.TestStringMapReferenceExecute(r) +} + +/* +TestStringMapReference test referenced string map + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestStringMapReferenceRequest +*/ +func (a *FakeAPIService) TestStringMapReference(ctx context.Context) ApiTestStringMapReferenceRequest { + return ApiTestStringMapReferenceRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *FakeAPIService) TestStringMapReferenceExecute(r ApiTestStringMapReferenceRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeAPIService.TestStringMapReference") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/stringMap-reference" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return nil, reportError("requestBody 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.requestBody + 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 ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest 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 a8b1f40e9d0f..deb2d5c92150 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md @@ -22,6 +22,7 @@ Method | HTTP request | Description [**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 | +[**TestStringMapReference**](FakeAPI.md#TestStringMapReference) | **Post** /fake/stringMap-reference | test referenced string map [**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](FakeAPI.md#TestUniqueItemsHeaderAndQueryParameterCollectionFormat) | **Put** /fake/test-unique-parameters | @@ -1248,6 +1249,70 @@ No authorization required [[Back to README]](../README.md) +## TestStringMapReference + +> TestStringMapReference(ctx).RequestBody(requestBody).Execute() + +test referenced string map + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + requestBody := map[string]string{"key": "Inner_example"} // map[string]string | request body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestStringMapReference(context.Background()).RequestBody(requestBody).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestStringMapReference``: %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 apiTestStringMapReferenceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | **map[string]string** | 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) + + ## TestUniqueItemsHeaderAndQueryParameterCollectionFormat > []Pet TestUniqueItemsHeaderAndQueryParameterCollectionFormat(ctx).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute() diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/README.md b/samples/openapi3/client/petstore/java/jersey2-java8/README.md index f29fdc674617..b0d242082a7c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/README.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/README.md @@ -157,6 +157,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet 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 8f79a7c4c5a8..07f944065424 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -956,6 +956,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1783,6 +1802,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 55a9c935065e..567b5637ad2c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**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 | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -1195,3 +1196,67 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.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); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | **Map<String,String>**| 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 | - | + 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 93ac0bd8b56f..16da83fca1c6 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 @@ -971,4 +971,43 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, null, null, false); } + /** + * test referenced string map + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testStringMapReference(Map requestBody) throws ApiException { + testStringMapReferenceWithHttpInfo(requestBody); + } + + /** + * test referenced string map + * + * @param requestBody 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 testStringMapReferenceWithHttpInfo(Map requestBody) throws ApiException { + // Check required parameters + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testStringMapReference", "/fake/stringMap-reference", "POST", new ArrayList<>(), requestBody, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); + } } diff --git a/samples/openapi3/client/petstore/python-aiohttp/README.md b/samples/openapi3/client/petstore/python-aiohttp/README.md index e9b47709917f..93d1a926bece 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-aiohttp/README.md @@ -112,6 +112,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md index 5f02b061a811..bfc99639b1b5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map # **fake_any_type_request_body** @@ -1853,3 +1854,68 @@ 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_string_map_reference** +> test_string_map_reference(request_body) + +test referenced string map + + + +### Example + + +```python +import petstore_api +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) + request_body = {'key': 'request_body_example'} # Dict[str, str] | request body + + try: + # test referenced string map + await api_instance.test_string_map_reference(request_body) + except Exception as e: + print("Exception when calling FakeApi->test_string_map_reference: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Dict[str, str]**](str.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) + 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 85725365c3e9..e456e7adceb4 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 @@ -7261,3 +7261,267 @@ def _test_query_parameter_collection_format_serialize( ) + + + @validate_call + async def test_string_map_reference( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_string_map_reference_with_http_info( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_string_map_reference_without_preload_content( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_string_map_reference_serialize( + self, + request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request_body is not None: + _body_params = request_body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/stringMap-reference', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md index 1fce8fd01d1c..b284e2059c87 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md @@ -113,6 +113,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FakeApi.md index 7f9563a2ec49..1f2d1f92a369 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FakeApi.md @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map # **fake_any_type_request_body** @@ -1827,3 +1828,67 @@ 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_string_map_reference** +> test_string_map_reference(request_body) + +test referenced string map + + + +### Example + +```python +import time +import os +import petstore_api +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) + request_body = {'key': 'request_body_example'} # Dict[str, str] | request body + + try: + # test referenced string map + await api_instance.test_string_map_reference(request_body) + except Exception as e: + print("Exception when calling FakeApi->test_string_map_reference: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Dict[str, str]**](str.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) + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/api/fake_api.py index 39615b9e8074..4d186fd08215 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/api/fake_api.py @@ -3491,3 +3491,128 @@ async def test_query_parameter_collection_format_with_http_info(self, pipe : con _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + + @validate_arguments + async def test_string_map_reference(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs) -> None: # noqa: E501 + """test referenced string map # noqa: E501 + + # noqa: E501 + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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_string_map_reference_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_string_map_reference_with_http_info(request_body, **kwargs) # noqa: E501 + + @validate_arguments + async def test_string_map_reference_with_http_info(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs) -> ApiResponse: # noqa: E501 + """test referenced string map # noqa: E501 + + # noqa: E501 + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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 = [ + 'request_body' + ] + _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_string_map_reference" % _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['request_body'] is not None: + _body_params = _params['request_body'] + + # 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/stringMap-reference', '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')) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/README.md b/samples/openapi3/client/petstore/python-pydantic-v1/README.md index be2a4c20fcfa..3cc746aa66fe 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/README.md @@ -113,6 +113,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FakeApi.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FakeApi.md index 1612ebbd0724..decfaf17331f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FakeApi.md @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map # **fake_any_type_request_body** @@ -1827,3 +1828,67 @@ 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_string_map_reference** +> test_string_map_reference(request_body) + +test referenced string map + + + +### Example + +```python +import time +import os +import petstore_api +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) + request_body = {'key': 'request_body_example'} # Dict[str, str] | request body + + try: + # test referenced string map + api_instance.test_string_map_reference(request_body) + except Exception as e: + print("Exception when calling FakeApi->test_string_map_reference: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Dict[str, str]**](str.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) + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/api/fake_api.py index debba27e4f77..d8ffa0b1c532 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/api/fake_api.py @@ -3906,3 +3906,144 @@ def test_query_parameter_collection_format_with_http_info(self, pipe : conlist(S _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + + @validate_arguments + def test_string_map_reference(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs) -> None: # noqa: E501 + """test referenced string map # 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_string_map_reference(request_body, async_req=True) + >>> result = thread.get() + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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_string_map_reference_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.test_string_map_reference_with_http_info(request_body, **kwargs) # noqa: E501 + + @validate_arguments + def test_string_map_reference_with_http_info(self, request_body : Annotated[Dict[str, StrictStr], Field(..., description="request body")], **kwargs) -> ApiResponse: # noqa: E501 + """test referenced string map # 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_string_map_reference_with_http_info(request_body, async_req=True) + >>> result = thread.get() + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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 = [ + 'request_body' + ] + _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_string_map_reference" % _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['request_body'] is not None: + _body_params = _params['request_body'] + + # 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/stringMap-reference', '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')) diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 419d744d6ee9..07f3cb8623c6 100755 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -112,6 +112,7 @@ Class | Method | HTTP request | Description *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 | +*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 033744514748..1ae6176a1ce3 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -30,6 +30,7 @@ Method | HTTP request | Description [**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 | +[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map # **fake_any_type_request_body** @@ -1853,3 +1854,68 @@ 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_string_map_reference** +> test_string_map_reference(request_body) + +test referenced string map + + + +### Example + + +```python +import petstore_api +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) + request_body = {'key': 'request_body_example'} # Dict[str, str] | request body + + try: + # test referenced string map + api_instance.test_string_map_reference(request_body) + except Exception as e: + print("Exception when calling FakeApi->test_string_map_reference: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Dict[str, str]**](str.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) + 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 8323fe6a0806..f3a96ef9723a 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 @@ -7261,3 +7261,267 @@ def _test_query_parameter_collection_format_serialize( ) + + + @validate_call + def test_string_map_reference( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def test_string_map_reference_with_http_info( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def test_string_map_reference_without_preload_content( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_string_map_reference_serialize( + self, + request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request_body is not None: + _body_params = request_body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/stringMap-reference', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + 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 ae12d48df310..212c3deee0e7 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 @@ -2427,6 +2427,121 @@ std::string FakeTest_query_parametersResource::extractFormParamsFromBody(const s } return ""; } +FakeStringMap_referenceResource::FakeStringMap_referenceResource(const std::string& context /* = "/v2" */) +{ + this->set_path(context + "/fake/stringMap-reference"); + this->set_method_handler("POST", + std::bind(&FakeStringMap_referenceResource::handler_POST_internal, this, + std::placeholders::_1)); +} + +std::pair FakeStringMap_referenceResource::handleFakeApiException(const FakeApiException& e) +{ + return std::make_pair(e.getStatus(), e.what()); +} + +std::pair FakeStringMap_referenceResource::handleStdException(const std::exception& e) +{ + return std::make_pair(500, e.what()); +} + +std::pair FakeStringMap_referenceResource::handleUnspecifiedException() +{ + return std::make_pair(500, "Unknown exception occurred"); +} + +void FakeStringMap_referenceResource::setResponseHeader(const std::shared_ptr& session, const std::string& header) +{ + session->set_header(header, ""); +} + +void FakeStringMap_referenceResource::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 FakeStringMap_referenceResource::defaultSessionClose(const std::shared_ptr& session, const int status, const std::string& result) +{ + session->close(status, result, { {"Connection", "close"} }); +} + +void FakeStringMap_referenceResource::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); + std::map requestBody; // TODO + + int status_code = 500; + std::string result = ""; + + try { + status_code = + handler_POST(requestBody); + } + 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 FakeStringMap_referenceResource::handler_POST( + std::map & requestBody) +{ + return handler_POST_func(requestBody); +} + + +std::string FakeStringMap_referenceResource::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 FakeStringMap_referenceResource::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 ""; +} } /* namespace FakeApiResources */ @@ -2545,6 +2660,12 @@ std::shared_ptr FakeApi::ge } return m_spFakeTest_query_parametersResource; } +std::shared_ptr FakeApi::getFakeStringMap_referenceResource() { + if (!m_spFakeStringMap_referenceResource) { + setResource(std::make_shared()); + } + return m_spFakeStringMap_referenceResource; +} void FakeApi::setResource(std::shared_ptr resource) { m_spFakeBigDecimalMapResource = resource; m_service->publish(m_spFakeBigDecimalMapResource); @@ -2617,6 +2738,10 @@ void FakeApi::setResource(std::shared_ptrpublish(m_spFakeTest_query_parametersResource); } +void FakeApi::setResource(std::shared_ptr resource) { + m_spFakeStringMap_referenceResource = resource; + m_service->publish(m_spFakeStringMap_referenceResource); +} void FakeApi::setFakeApiFakeBigDecimalMapResource(std::shared_ptr spFakeBigDecimalMapResource) { m_spFakeBigDecimalMapResource = spFakeBigDecimalMapResource; m_service->publish(m_spFakeBigDecimalMapResource); @@ -2689,6 +2814,10 @@ void FakeApi::setFakeApiFakeTest_query_parametersResource(std::shared_ptrpublish(m_spFakeTest_query_parametersResource); } +void FakeApi::setFakeApiFakeStringMap_referenceResource(std::shared_ptr spFakeStringMap_referenceResource) { + m_spFakeStringMap_referenceResource = spFakeStringMap_referenceResource; + m_service->publish(m_spFakeStringMap_referenceResource); +} void FakeApi::publishDefaultResources() { @@ -2746,6 +2875,9 @@ void FakeApi::publishDefaultResources() { if (!m_spFakeTest_query_parametersResource) { setResource(std::make_shared()); } + if (!m_spFakeStringMap_referenceResource) { + setResource(std::make_shared()); + } } std::shared_ptr FakeApi::service() { 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 cce6d9bce998..4f02405f373a 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 @@ -1211,6 +1211,68 @@ class FakeTest_query_parametersResource: public restbed::Resource void handler_PUT_internal(const std::shared_ptr session); }; +/// +/// test referenced string map +/// +/// +/// +/// +class FakeStringMap_referenceResource: public restbed::Resource +{ +public: + FakeStringMap_referenceResource(const std::string& context = "/v2"); + virtual ~FakeStringMap_referenceResource() = default; + + FakeStringMap_referenceResource( + const FakeStringMap_referenceResource& other) = default; // copy constructor + FakeStringMap_referenceResource(FakeStringMap_referenceResource&& other) noexcept = default; // move constructor + + FakeStringMap_referenceResource& operator=(const FakeStringMap_referenceResource& other) = default; // copy assignment + FakeStringMap_referenceResource& operator=(FakeStringMap_referenceResource&& other) noexcept = default; // move assignment + + ///////////////////////////////////////////////////// + // Set these to implement the server functionality // + ///////////////////////////////////////////////////// + std::function & requestBody)> handler_POST_func = + [](std::map &) -> 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( + 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); +}; + } /* namespace FakeApiResources */ using FakeApiFakeBigDecimalMapResource [[deprecated]] = FakeApiResources::FakeBigDecimalMapResource; @@ -1231,6 +1293,7 @@ using FakeApiFakeInline_freeform_additionalPropertiesResource [[deprecated]] = F using FakeApiFakeJsonFormDataResource [[deprecated]] = FakeApiResources::FakeJsonFormDataResource; using FakeApiFakeNullableResource [[deprecated]] = FakeApiResources::FakeNullableResource; using FakeApiFakeTest_query_parametersResource [[deprecated]] = FakeApiResources::FakeTest_query_parametersResource; +using FakeApiFakeStringMap_referenceResource [[deprecated]] = FakeApiResources::FakeStringMap_referenceResource; // // The restbed service to actually implement the REST server @@ -1259,6 +1322,7 @@ class FakeApi std::shared_ptr getFakeJsonFormDataResource(); std::shared_ptr getFakeNullableResource(); std::shared_ptr getFakeTest_query_parametersResource(); + std::shared_ptr getFakeStringMap_referenceResource(); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); @@ -1278,6 +1342,7 @@ class FakeApi void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); void setResource(std::shared_ptr resource); + void setResource(std::shared_ptr resource); [[deprecated("use setResource()")]] virtual void setFakeApiFakeBigDecimalMapResource(std::shared_ptr spFakeApiFakeBigDecimalMapResource); [[deprecated("use setResource()")]] @@ -1314,6 +1379,8 @@ class FakeApi virtual void setFakeApiFakeNullableResource(std::shared_ptr spFakeApiFakeNullableResource); [[deprecated("use setResource()")]] virtual void setFakeApiFakeTest_query_parametersResource(std::shared_ptr spFakeApiFakeTest_query_parametersResource); + [[deprecated("use setResource()")]] + virtual void setFakeApiFakeStringMap_referenceResource(std::shared_ptr spFakeApiFakeStringMap_referenceResource); virtual void publishDefaultResources(); @@ -1338,6 +1405,7 @@ class FakeApi std::shared_ptr m_spFakeJsonFormDataResource; std::shared_ptr m_spFakeNullableResource; std::shared_ptr m_spFakeTest_query_parametersResource; + std::shared_ptr m_spFakeStringMap_referenceResource; private: std::shared_ptr m_service; diff --git a/samples/server/petstore/java-helidon-server/mp/README.md b/samples/server/petstore/java-helidon-server/mp/README.md index 420f8ddd67bc..323a58c291c1 100644 --- a/samples/server/petstore/java-helidon-server/mp/README.md +++ b/samples/server/petstore/java-helidon-server/mp/README.md @@ -34,6 +34,7 @@ curl -X POST http://petstore.swagger.io:80/v2/inline-freeform-additionalProperti 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 +curl -X POST http://petstore.swagger.io:80/v2/stringMap-reference curl -X PATCH http://petstore.swagger.io:80/v2 curl -X POST http://petstore.swagger.io:80/v2/pet curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId} 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 320ff2d6350e..97928b702fc6 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 @@ -146,4 +146,9 @@ public interface FakeService { @PUT @Path("/test-query-parameters") void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context, @QueryParam("allowEmpty") @NotNull String allowEmpty, @QueryParam("language") Map language); + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(@Valid @NotNull Map requestBody); } 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 a9b10d16ad8f..462d5789ce1d 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 @@ -184,4 +184,10 @@ public void testNullable(@Valid @NotNull ChildWithNullable childWithNullable) { @Path("/test-query-parameters") public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { } + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + public void testStringMapReference(@Valid @NotNull Map requestBody) { + } } 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 27ee0c195b9b..f61c7cc0cd8a 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 @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed diff --git a/samples/server/petstore/java-helidon-server/se/README.md b/samples/server/petstore/java-helidon-server/se/README.md index 9d1d931646dc..3442efc621ab 100644 --- a/samples/server/petstore/java-helidon-server/se/README.md +++ b/samples/server/petstore/java-helidon-server/se/README.md @@ -34,6 +34,7 @@ curl -X POST http://petstore.swagger.io:80/v2/fake/inline-freeform-additionalPro 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 +curl -X POST http://petstore.swagger.io:80/v2/fake/stringMap-reference curl -X PATCH http://petstore.swagger.io:80/v2/fake_classname_test curl -X POST http://petstore.swagger.io:80/v2/pet curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId} 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 320cfd74d393..6455447871e9 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 @@ -54,6 +54,7 @@ default void update(Routing.Rules rules) { rules.get("/fake/jsonFormData", this::testJsonFormData); rules.post("/fake/nullable", Handler.create(ChildWithNullable.class, this::testNullable)); rules.put("/fake/test-query-parameters", this::testQueryParameterCollectionFormat); + rules.post("/fake/stringMap-reference", this::testStringMapReference); } @@ -212,4 +213,11 @@ default void update(Routing.Rules rules) { */ void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response); + /** + * POST /fake/stringMap-reference : test referenced string map. + * @param request the server request + * @param response the server response + */ + void testStringMapReference(ServerRequest request, ServerResponse response); + } 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 b92126a893a9..6d4fe55bbe02 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 @@ -115,4 +115,8 @@ public void testQueryParameterCollectionFormat(ServerRequest request, ServerResp response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); } + public void testStringMapReference(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + } 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 27ee0c195b9b..f61c7cc0cd8a 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 @@ -1029,6 +1029,25 @@ paths: - fake x-content-type: application/json x-accepts: application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: application/json /fake/inline-additionalProperties: post: description: "" @@ -1874,6 +1893,11 @@ components: additionalProperties: true description: A schema consisting only of additional properties type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed 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 e8ad376c9e0b..6791d53d090d 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 @@ -331,6 +331,18 @@ public Response testQueryParameterCollectionFormat(@ApiParam(value = "", require return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } @javax.ws.rs.POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + + @io.swagger.annotations.ApiOperation(value = "test referenced string map", 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 testStringMapReference(@ApiParam(value = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testStringMapReference(requestBody, securityContext); + } + @javax.ws.rs.POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) 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 027b1d38e1c1..8200ebf286d6 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 @@ -53,5 +53,6 @@ public abstract class FakeApiService { 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; + public abstract Response testStringMapReference(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,FormDataBodyPart requiredFileBodypart,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 7c4cfb0c4aa0..3e1330c4602b 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 @@ -137,6 +137,11 @@ public Response testQueryParameterCollectionFormat( @NotNull List pipe, return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testStringMapReference(Map requestBody, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, FormDataBodyPart requiredFileBodypart, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java index 17fd4690a999..f2d45d281bff 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java @@ -330,6 +330,18 @@ public Response testQueryParameterCollectionFormat(@Schema(description = "") @Qu return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } + @jakarta.ws.rs.POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + @Operation(summary = "test referenced string map", description = "", responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = + @Content(schema = @Schema(implementation = Void.class))), + }, tags={ "fake", }) + public Response testStringMapReference(@Schema(description = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testStringMapReference(requestBody, securityContext); + } + @jakarta.ws.rs.POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApiService.java index f267dd5ff687..ce6c5537f079 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApiService.java @@ -53,5 +53,6 @@ public abstract class FakeApiService { 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; + public abstract Response testStringMapReference(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,FormDataBodyPart requiredFileBodypart,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey3/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index a743e03067f5..391bce8806cf 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey3/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -137,6 +137,11 @@ public Response testQueryParameterCollectionFormat( @NotNull List pipe, return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testStringMapReference(Map requestBody, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, FormDataBodyPart requiredFileBodypart, String additionalMetadata, 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/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index 39ba64eab6c5..260e3f6fd31d 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 @@ -606,6 +606,30 @@ public function fakePropertyEnumIntegerSerialize() return response('How about implementing fakePropertyEnumIntegerSerialize as a post method ?'); } + /** + * Operation testStringMapReference + * + * test referenced string map. + * + * + * @return Http response + */ + public function testStringMapReference() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['requestBody'])) { + throw new \InvalidArgumentException('Missing the required parameter $requestBody when calling testStringMapReference'); + } + $requestBody = $input['requestBody']; + + + return response('How about implementing testStringMapReference as a post method ?'); + } /** * Operation testQueryParameterCollectionFormat * diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index 6dfbb686cec3..7f1a9f1bf164 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -175,6 +175,13 @@ * Output-Formats: [*_/_*] */ Route::post('/v2/fake/property/enum-int', 'FakeController@fakePropertyEnumIntegerSerialize'); +/** + * post testStringMapReference + * Summary: test referenced string map + * Notes: + + */ +Route::post('/v2/fake/stringMap-reference', 'FakeController@testStringMapReference'); /** * put testQueryParameterCollectionFormat * Summary: diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index f1e0ec001d65..984dd7ac20b9 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -602,6 +602,30 @@ public function fakePropertyEnumIntegerSerialize() return response('How about implementing fakePropertyEnumIntegerSerialize as a post method ?'); } + /** + * Operation testStringMapReference + * + * test referenced string map. + * + * + * @return Http response + */ + public function testStringMapReference() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['request_body'])) { + throw new \InvalidArgumentException('Missing the required parameter $request_body when calling testStringMapReference'); + } + $request_body = $input['request_body']; + + + return response('How about implementing testStringMapReference as a post method ?'); + } /** * Operation testQueryParameterCollectionFormat * diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index 59762b6f3810..dfd864d4d144 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -191,6 +191,13 @@ */ $router->post('/v2/fake/property/enum-int', 'FakeApi@fakePropertyEnumIntegerSerialize'); +/** + * post testStringMapReference + * Summary: test referenced string map + * Notes: + */ +$router->post('/v2/fake/stringMap-reference', 'FakeApi@testStringMapReference'); + /** * put testQueryParameterCollectionFormat * Summary: