File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33{ {> partial_header} }
44
55
6+ { {#async} }
67import base64
8+ { {/async} }
79import copy
810import http.client as httplib
911import logging
@@ -621,9 +623,16 @@ conf = {{{packageName}}}.Configuration(
621623 if self.password is not None:
622624 password = self.password
623625
626+ { {#async} }
624627 return "Basic " + base64.b64encode(
625628 (username + ":" + password).encode('utf-8')
626629 ).decode('utf-8')
630+ { {/async} }
631+ { {^async} }
632+ return urllib3.util.make_headers(
633+ basic_auth=username + ':' + password
634+ ).get('authorization')
635+ { {/async} }
627636
628637 def auth_settings(self)-> AuthSettings:
629638 """Gets Auth Settings dict for api client.
@@ -726,6 +735,11 @@ conf = {{{packageName}}}.Configuration(
726735 ]
727736 { {/-last} }
728737 { {/enumValues} }
738+ { {^enumValues} }
739+ { {#async} }
740+ 'enum_values': []
741+ { {/async} }
742+ { {/enumValues} }
729743 }{ {^-last} },{ {/-last} }
730744 { {#-last} }
731745 }
@@ -768,6 +782,7 @@ conf = {{{packageName}}}.Configuration(
768782 variable_name, variable['default_value'])
769783
770784 if 'enum_values' in variable \
785+ and variable['enum_values'] \
771786 and used_value not in variable['enum_values']:
772787 raise ValueError(
773788 "The variable `{ 0} ` in the host URL has invalid value "
You can’t perform that action at this time.
0 commit comments