Revert "Fixed the typo for incorrect codegen"

This reverts commit 341432457182b20400006f41e8813d9d98014e02.
This commit is contained in:
morpheus-30
2023-07-04 23:18:27 +05:30
parent 3034aa80d5
commit 9287021b84
2 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@ print(data.decode("utf-8"))
result += result +=
"""headers = {\n'Content-Type':'${requestModel.requestBodyContentType == ContentType.json ? 'application/json' : 'text/plain'}'\n${addHeaders(requestModel)}},\n"""; """headers = {\n'Content-Type':'${requestModel.requestBodyContentType == ContentType.json ? 'application/json' : 'text/plain'}'\n${addHeaders(requestModel)}},\n""";
result += 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; result += footerSnippet;
return result; return result;

View File

@ -21,7 +21,7 @@ payload = json.dumps()
headers = { headers = {
'Content-Type':'application/json' 'Content-Type':'application/json'
}, },
conn.request("GET", "/todos/1", payload, headers) conn.request("GET", "/todos/1", payload, headers)}
res = conn.getresponse() res = conn.getresponse()
data = res.read() data = res.read()
print(data.decode("utf-8")) print(data.decode("utf-8"))
@ -45,7 +45,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1})
headers = { headers = {
'Content-Type':'application/json' 'Content-Type':'application/json'
}, },
conn.request("POST", "/todos", payload, headers) conn.request("POST", "/todos", payload, headers)}
res = conn.getresponse() res = conn.getresponse()
data = res.read() data = res.read()
print(data.decode("utf-8")) print(data.decode("utf-8"))
@ -69,7 +69,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1})
headers = { headers = {
'Content-Type':'application/json' 'Content-Type':'application/json'
}, },
conn.request("DELETE", "/todos/1", payload, headers) conn.request("DELETE", "/todos/1", payload, headers)}
res = conn.getresponse() res = conn.getresponse()
data = res.read() data = res.read()
print(data.decode("utf-8")) print(data.decode("utf-8"))
@ -91,7 +91,7 @@ payload = json.dumps()
headers = { headers = {
'Content-Type':'application/json' 'Content-Type':'application/json'
}, },
conn.request("HEAD", "/todos/1", payload, headers) conn.request("HEAD", "/todos/1", payload, headers)}
res = conn.getresponse() res = conn.getresponse()
data = res.read() data = res.read()
print(data.decode("utf-8")) print(data.decode("utf-8"))
@ -124,7 +124,7 @@ headers = {
'Custom-Header-1':'Value-1', 'Custom-Header-1':'Value-1',
'Custom-Header-2':'Value-2', 'Custom-Header-2':'Value-2',
}, },
conn.request("GET", "/posts?userId=1", payload, headers) conn.request("GET", "/posts?userId=1", payload, headers)}
res = conn.getresponse() res = conn.getresponse()
data = res.read() data = res.read()
print(data.decode("utf-8")) print(data.decode("utf-8"))