Skip to content

Commit

Permalink
Revert "[typescript-fetch] Support deepObject query params (OpenAPITo…
Browse files Browse the repository at this point in the history
…ols#6075)"

This reverts commit 354f195.

It became superfluous due to some other changes in runtime and changing
of the queryParameters in d9a6f4d
  • Loading branch information
haraldF committed Jul 4, 2020
1 parent 6c1aecb commit c251667
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,9 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
this.addOperationObjectResponseInformation(operations);
this.addOperationPrefixParameterInterfacesInformation(operations);
this.escapeOperationIds(operations);
this.addDeepObjectVendorExtension(operations);
return operations;
}

private void addDeepObjectVendorExtension(Map<String, Object> operations) {
Map<String, Object> _operations = (Map<String, Object>) operations.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) _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<String, Object> operations) {
Map<String, Object> _operations = (Map<String, Object>) operations.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) _operations.get("operation");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
}
Expand Down

0 comments on commit c251667

Please sign in to comment.