From 9287021b84a14372ec94fa6b8430ea376a87ba64 Mon Sep 17 00:00:00 2001 From: morpheus-30 Date: Tue, 4 Jul 2023 23:18:27 +0530 Subject: [PATCH] Revert "Fixed the typo for incorrect codegen" This reverts commit 341432457182b20400006f41e8813d9d98014e02. --- lib/codegen/python/pkg_http_client.dart | 2 +- test/codegen/python_http_client_codegen_test.dart | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/codegen/python/pkg_http_client.dart b/lib/codegen/python/pkg_http_client.dart index 1be3f34d..22e93299 100644 --- a/lib/codegen/python/pkg_http_client.dart +++ b/lib/codegen/python/pkg_http_client.dart @@ -24,7 +24,7 @@ print(data.decode("utf-8")) result += """headers = {\n'Content-Type':'${requestModel.requestBodyContentType == ContentType.json ? 'application/json' : 'text/plain'}'\n${addHeaders(requestModel)}},\n"""; result += - "conn.request(\"${requestModel.method.name.toUpperCase()}\", \"${getUrl(requestModel)["endpoint"]}${addQueryParams(requestModel)}\", payload, headers)\n"; + "conn.request(\"${requestModel.method.name.toUpperCase()}\", \"${getUrl(requestModel)["endpoint"]}${addQueryParams(requestModel)}\", payload, headers)}\n"; result += footerSnippet; return result; diff --git a/test/codegen/python_http_client_codegen_test.dart b/test/codegen/python_http_client_codegen_test.dart index c944a90b..a665f6d3 100644 --- a/test/codegen/python_http_client_codegen_test.dart +++ b/test/codegen/python_http_client_codegen_test.dart @@ -21,7 +21,7 @@ payload = json.dumps() headers = { 'Content-Type':'application/json' }, -conn.request("GET", "/todos/1", payload, headers) +conn.request("GET", "/todos/1", payload, headers)} res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -45,7 +45,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1}) headers = { 'Content-Type':'application/json' }, -conn.request("POST", "/todos", payload, headers) +conn.request("POST", "/todos", payload, headers)} res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -69,7 +69,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1}) headers = { 'Content-Type':'application/json' }, -conn.request("DELETE", "/todos/1", payload, headers) +conn.request("DELETE", "/todos/1", payload, headers)} res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -91,7 +91,7 @@ payload = json.dumps() headers = { 'Content-Type':'application/json' }, -conn.request("HEAD", "/todos/1", payload, headers) +conn.request("HEAD", "/todos/1", payload, headers)} res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -124,7 +124,7 @@ headers = { 'Custom-Header-1':'Value-1', 'Custom-Header-2':'Value-2', }, -conn.request("GET", "/posts?userId=1", payload, headers) +conn.request("GET", "/posts?userId=1", payload, headers)} res = conn.getresponse() data = res.read() print(data.decode("utf-8"))