From 566b2b76477b3d1f6de222dd3f9f29f5f5051b18 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 7 Jul 2020 13:44:25 +0200 Subject: [PATCH] Revert "[typescript-fetch] Support deepObject query params (#6075)" (#6860) This reverts commit 354f195ec09293cfd731b72e67c3cc977b8c0894. It became superfluous due to some other changes in runtime and changing of the queryParameters in d9a6f4d --- .../languages/TypeScriptFetchClientCodegen.java | 14 -------------- .../main/resources/typescript-fetch/apis.mustache | 5 ----- 2 files changed, 19 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index c5b857ef2cd9..eec358455da5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -247,23 +247,9 @@ public Map postProcessOperationsWithModels(Map o this.addOperationObjectResponseInformation(operations); this.addOperationPrefixParameterInterfacesInformation(operations); this.escapeOperationIds(operations); - this.addDeepObjectVendorExtension(operations); return operations; } - private void addDeepObjectVendorExtension(Map operations) { - Map _operations = (Map) operations.get("operations"); - List operationList = (List) _operations.get("operation"); - - for (CodegenOperation op : operationList) { - for (CodegenParameter param : op.queryParams) { - if (param.style != null && param.style.equals("deepObject")) { - param.vendorExtensions.put("x-codegen-isDeepObject", true); - } - } - } - } - private void escapeOperationIds(Map operations) { Map _operations = (Map) operations.get("operations"); List operationList = (List) _operations.get("operation"); diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index be03f0eb1771..056e0dbb2677 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -122,12 +122,7 @@ export class {{classname}} extends runtime.BaseAPI { queryParameters['{{baseName}}'] = (requestParameters.{{paramName}} as any).toISOString().substr(0,10); {{/isDate}} {{^isDate}} - {{#vendorExtensions.x-codegen-isDeepObject}} - queryParameters['{{baseName}}'] = runtime.querystring(requestParameters.{{paramName}} as unknown as runtime.HTTPQuery, '{{baseName}}'); - {{/vendorExtensions.x-codegen-isDeepObject}} - {{^vendorExtensions.x-codegen-isDeepObject}} queryParameters['{{baseName}}'] = requestParameters.{{paramName}}; - {{/vendorExtensions.x-codegen-isDeepObject}} {{/isDate}} {{/isDateTime}} }