Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit b8f9e01

Browse files
committed
Samples regenerated
1 parent 688c7aa commit b8f9e01

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ class ApiClient:
994994
self.pool_threads = pool_threads
995995

996996
self.rest_client = rest.RESTClientObject(configuration)
997-
self.default_headers = {}
997+
self.default_headers = HTTPHeaderDict()
998998
if header_name is not None:
999999
self.default_headers[header_name] = header_value
10001000
self.cookie = cookie
@@ -1054,8 +1054,9 @@ class ApiClient:
10541054
) -> urllib3.HTTPResponse:
10551055

10561056
# header parameters
1057-
headers = headers or HTTPHeaderDict()
1058-
headers.update(self.default_headers)
1057+
used_headers = HTTPHeaderDict(self.default_headers)
1058+
if headers:
1059+
used_headers.extend(headers)
10591060
if self.cookie:
10601061
headers['Cookie'] = self.cookie
10611062

@@ -1074,7 +1075,7 @@ class ApiClient:
10741075
response = {{#if asyncio}}await {{/if}}{{#if tornado}}yield {{/if}}self.request(
10751076
method,
10761077
url,
1077-
headers=headers,
1078+
headers=used_headers,
10781079
fields=fields,
10791080
body=body,
10801081
stream=stream,

samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ def __init__(
998998
self.pool_threads = pool_threads
999999

10001000
self.rest_client = rest.RESTClientObject(configuration)
1001-
self.default_headers = {}
1001+
self.default_headers = HTTPHeaderDict()
10021002
if header_name is not None:
10031003
self.default_headers[header_name] = header_value
10041004
self.cookie = cookie
@@ -1055,8 +1055,9 @@ def __call_api(
10551055
) -> urllib3.HTTPResponse:
10561056

10571057
# header parameters
1058-
headers = headers or HTTPHeaderDict()
1059-
headers.update(self.default_headers)
1058+
used_headers = HTTPHeaderDict(self.default_headers)
1059+
if headers:
1060+
used_headers.extend(headers)
10601061
if self.cookie:
10611062
headers['Cookie'] = self.cookie
10621063

@@ -1075,7 +1076,7 @@ def __call_api(
10751076
response = self.request(
10761077
method,
10771078
url,
1078-
headers=headers,
1079+
headers=used_headers,
10791080
fields=fields,
10801081
body=body,
10811082
stream=stream,

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ def __init__(
998998
self.pool_threads = pool_threads
999999

10001000
self.rest_client = rest.RESTClientObject(configuration)
1001-
self.default_headers = {}
1001+
self.default_headers = HTTPHeaderDict()
10021002
if header_name is not None:
10031003
self.default_headers[header_name] = header_value
10041004
self.cookie = cookie
@@ -1055,8 +1055,9 @@ def __call_api(
10551055
) -> urllib3.HTTPResponse:
10561056

10571057
# header parameters
1058-
headers = headers or HTTPHeaderDict()
1059-
headers.update(self.default_headers)
1058+
used_headers = HTTPHeaderDict(self.default_headers)
1059+
if headers:
1060+
used_headers.extend(headers)
10601061
if self.cookie:
10611062
headers['Cookie'] = self.cookie
10621063

@@ -1075,7 +1076,7 @@ def __call_api(
10751076
response = self.request(
10761077
method,
10771078
url,
1078-
headers=headers,
1079+
headers=used_headers,
10791080
fields=fields,
10801081
body=body,
10811082
stream=stream,

samples/openapi3/client/petstore/python/petstore_api/api_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ def __init__(
998998
self.pool_threads = pool_threads
999999

10001000
self.rest_client = rest.RESTClientObject(configuration)
1001-
self.default_headers = {}
1001+
self.default_headers = HTTPHeaderDict()
10021002
if header_name is not None:
10031003
self.default_headers[header_name] = header_value
10041004
self.cookie = cookie
@@ -1055,8 +1055,9 @@ def __call_api(
10551055
) -> urllib3.HTTPResponse:
10561056

10571057
# header parameters
1058-
headers = headers or HTTPHeaderDict()
1059-
headers.update(self.default_headers)
1058+
used_headers = HTTPHeaderDict(self.default_headers)
1059+
if headers:
1060+
used_headers.extend(headers)
10601061
if self.cookie:
10611062
headers['Cookie'] = self.cookie
10621063

@@ -1075,7 +1076,7 @@ def __call_api(
10751076
response = self.request(
10761077
method,
10771078
url,
1078-
headers=headers,
1079+
headers=used_headers,
10791080
fields=fields,
10801081
body=body,
10811082
stream=stream,

0 commit comments

Comments
 (0)