File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ class RESTClientObject:
128128 if re.search('json', headers['Content-Type'], re.IGNORECASE):
129129 if body is not None:
130130 body = json.dumps(body)
131+ if body is None and post_params:
132+ body = json.dumps(dict(post_params))
131133 args["data"] = body
132134 elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
133135 args["data"] = aiohttp.FormData(post_params)
Original file line number Diff line number Diff line change @@ -172,6 +172,8 @@ class RESTClientObject:
172172 request_body = None
173173 if body is not None:
174174 request_body = json.dumps(body)
175+ if body is None and post_params:
176+ request_body = json.dumps(dict(post_params))
175177 r = self.pool_manager.request(
176178 method, url,
177179 body=request_body,
Original file line number Diff line number Diff line change @@ -112,6 +112,8 @@ class RESTClientObject:
112112 if re.search('json', headers['Content-Type'], re.IGNORECASE):
113113 if body:
114114 body = json.dumps(body)
115+ if body is None and post_params:
116+ body = json.dumps(dict(post_params))
115117 request.body = body
116118 elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
117119 request.body = urlencode(post_params)
Original file line number Diff line number Diff line change @@ -156,6 +156,8 @@ class RESTClientObject:
156156 if re.search('json', headers['Content-Type'], re.IGNORECASE):
157157 if body is not None:
158158 body = json.dumps(body)
159+ if body is None and post_params:
160+ body = json.dumps(dict(post_params))
159161 args["data"] = body
160162 elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
161163 args["data"] = aiohttp.FormData(post_params)
Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ class RESTClientObject:
128128 if re.search('json', headers['Content-Type'], re.IGNORECASE):
129129 if body is not None:
130130 args["json"] = body
131+ if body is None and post_params:
132+ args["json"] = dict(post_params)
131133 elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
132134 args["data"] = dict(post_params)
133135 elif headers['Content-Type'] == 'multipart/form-data':
Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ class RESTClientObject:
122122 if re.search('json', headers['Content-Type'], re.IGNORECASE):
123123 if body:
124124 body = json.dumps(body)
125+ if body is None and post_params:
126+ body = json.dumps(dict(post_params))
125127 request.body = body
126128 elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
127129 request.body = urlencode(post_params)
You can’t perform that action at this time.
0 commit comments