From 5e83dde8568ae3d7094636424190481247c5a481 Mon Sep 17 00:00:00 2001 From: Eddie Chayes <35413716+eddiechayes@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:28:04 -0800 Subject: [PATCH] Add x-konfig-prefix support in python generator (#595) * Add x-konfig-prefix support in python generator * update integration test SDKs --- .../src/main/resources/python/configuration.handlebars | 9 ++++++++- .../sdks/python/leap_workflows/configuration.py | 4 +++- .../python/python_async_default_timeout/configuration.py | 4 +++- .../configuration.py | 4 +++- .../python/python_async_timeout/configuration.py | 4 +++- .../sdks/python-carbon/python/carbon/configuration.py | 6 +++++- .../python/python_circular_reference/configuration.py | 4 +++- .../decentro_in_collections_client/configuration.py | 4 +++- .../python/python_invalid_response/configuration.py | 4 +++- .../python/newscatcherapi_client/configuration.py | 4 +++- .../configuration.py | 4 +++- .../configuration.py | 4 +++- .../python_pydantic_array_with_object/configuration.py | 4 +++- .../python_pydantic_empty_response/configuration.py | 4 +++- .../python/python_pydantic_enum_str/configuration.py | 4 +++- .../configuration.py | 4 +++- .../configuration.py | 4 +++- .../python_pydantic_list_in_union/configuration.py | 4 +++- .../python_pydantic_list_response/configuration.py | 4 +++- .../configuration.py | 4 +++- .../python_pydantic_nullable_string/configuration.py | 4 +++- .../configuration.py | 4 +++- .../configuration.py | 4 +++- .../configuration.py | 4 +++- .../python_pydantic_response_as_param/configuration.py | 4 +++- .../python/python_pydantic/configuration.py | 4 +++- .../configuration.py | 4 +++- .../python/python_pydantic_union/configuration.py | 4 +++- .../python/python_readme_header_snippet/configuration.py | 4 +++- .../python/python_typeddict/configuration.py | 4 +++- .../python_union_string_discriminator/configuration.py | 4 +++- .../python/python_splitit_client/configuration.py | 4 +++- 32 files changed, 103 insertions(+), 32 deletions(-) diff --git a/generator/konfig-generator-api/src/main/resources/python/configuration.handlebars b/generator/konfig-generator-api/src/main/resources/python/configuration.handlebars index 63970bcaba..6b998275b0 100644 --- a/generator/konfig-generator-api/src/main/resources/python/configuration.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/configuration.handlebars @@ -292,6 +292,13 @@ conf = {{{packageName}}}.Configuration( self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + {{#each apiKeyMethods}} + {{#if vendorExtensions.x-konfig-prefix}} + self.api_key_prefix['{{{name}}}'] = "{{{vendorExtensions.x-konfig-prefix}}}" + {{/if}} + {{/each}} + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -548,7 +555,7 @@ conf = {{{packageName}}}.Configuration( if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key {{#unless removeDefaultConfigurationParameters}} diff --git a/generator/konfig-integration-tests/sdks/leap-workflows/python-leap-workflows/sdks/python/leap_workflows/configuration.py b/generator/konfig-integration-tests/sdks/leap-workflows/python-leap-workflows/sdks/python/leap_workflows/configuration.py index 98024afee4..002aaa6fbd 100644 --- a/generator/konfig-integration-tests/sdks/leap-workflows/python-leap-workflows/sdks/python/leap_workflows/configuration.py +++ b/generator/konfig-integration-tests/sdks/leap-workflows/python-leap-workflows/sdks/python/leap_workflows/configuration.py @@ -147,6 +147,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -361,7 +363,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-async-default-timeout/python/python_async_default_timeout/configuration.py b/generator/konfig-integration-tests/sdks/python-async-default-timeout/python/python_async_default_timeout/configuration.py index 8891db94cf..afb8cf16e1 100644 --- a/generator/konfig-integration-tests/sdks/python-async-default-timeout/python/python_async_default_timeout/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-async-default-timeout/python/python_async_default_timeout/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-async-timeout-with-top-level-operation/python/python_async_timeout_with_top_level_operation/configuration.py b/generator/konfig-integration-tests/sdks/python-async-timeout-with-top-level-operation/python/python_async_timeout_with_top_level_operation/configuration.py index 17871c87bc..bc4945dcc9 100644 --- a/generator/konfig-integration-tests/sdks/python-async-timeout-with-top-level-operation/python/python_async_timeout_with_top_level_operation/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-async-timeout-with-top-level-operation/python/python_async_timeout_with_top_level_operation/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-async-timeout/python/python_async_timeout/configuration.py b/generator/konfig-integration-tests/sdks/python-async-timeout/python/python_async_timeout/configuration.py index 66cb19818e..d608d743a5 100644 --- a/generator/konfig-integration-tests/sdks/python-async-timeout/python/python_async_timeout/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-async-timeout/python/python_async_timeout/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-carbon/python/carbon/configuration.py b/generator/konfig-integration-tests/sdks/python-carbon/python/carbon/configuration.py index f094fc8c1d..c2a53e45ea 100644 --- a/generator/konfig-integration-tests/sdks/python-carbon/python/carbon/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-carbon/python/carbon/configuration.py @@ -142,6 +142,10 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + self.api_key_prefix['accessToken'] = "Token " + self.api_key_prefix['apiKey'] = "Bearer " + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -350,7 +354,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-circular-reference/python/python_circular_reference/configuration.py b/generator/konfig-integration-tests/sdks/python-circular-reference/python/python_circular_reference/configuration.py index 96cc469875..fef3754bbc 100644 --- a/generator/konfig-integration-tests/sdks/python-circular-reference/python/python_circular_reference/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-circular-reference/python/python_circular_reference/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-decentro/python/decentro_in_collections_client/configuration.py b/generator/konfig-integration-tests/sdks/python-decentro/python/decentro_in_collections_client/configuration.py index 4e566e9d7a..41f5ea4fc9 100644 --- a/generator/konfig-integration-tests/sdks/python-decentro/python/decentro_in_collections_client/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-decentro/python/decentro_in_collections_client/configuration.py @@ -154,6 +154,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -362,7 +364,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-invalid-response/python/python_invalid_response/configuration.py b/generator/konfig-integration-tests/sdks/python-invalid-response/python/python_invalid_response/configuration.py index 747d2e17e9..e929a212bb 100644 --- a/generator/konfig-integration-tests/sdks/python-invalid-response/python/python_invalid_response/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-invalid-response/python/python_invalid_response/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-newscatcher/python/newscatcherapi_client/configuration.py b/generator/konfig-integration-tests/sdks/python-newscatcher/python/newscatcherapi_client/configuration.py index 0e4d44cfa6..144ce72dfb 100644 --- a/generator/konfig-integration-tests/sdks/python-newscatcher/python/newscatcherapi_client/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-newscatcher/python/newscatcherapi_client/configuration.py @@ -147,6 +147,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -361,7 +363,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-additional-properties-anyof/python/python_pydantic_additional_properties_anyof/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-additional-properties-anyof/python/python_pydantic_additional_properties_anyof/configuration.py index 3ec0f1033b..68eccf9bc5 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-additional-properties-anyof/python/python_pydantic_additional_properties_anyof/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-additional-properties-anyof/python/python_pydantic_additional_properties_anyof/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-any-schema-dict-response/python/python_pydantic_any_schema_dict_response/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-any-schema-dict-response/python/python_pydantic_any_schema_dict_response/configuration.py index f85aae20aa..a72aafc4a4 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-any-schema-dict-response/python/python_pydantic_any_schema_dict_response/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-any-schema-dict-response/python/python_pydantic_any_schema_dict_response/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-array-with-object/python/python_pydantic_array_with_object/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-array-with-object/python/python_pydantic_array_with_object/configuration.py index 9baec392d2..aa94d9df2c 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-array-with-object/python/python_pydantic_array_with_object/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-array-with-object/python/python_pydantic_array_with_object/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-empty-response/python/python_pydantic_empty_response/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-empty-response/python/python_pydantic_empty_response/configuration.py index 0ffe99fa06..949c4965de 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-empty-response/python/python_pydantic_empty_response/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-empty-response/python/python_pydantic_empty_response/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-enum-str/python/python_pydantic_enum_str/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-enum-str/python/python_pydantic_enum_str/configuration.py index bd1dea835a..f7e9bae10e 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-enum-str/python/python_pydantic_enum_str/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-enum-str/python/python_pydantic_enum_str/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-property/python/python_pydantic_free_form_object_property/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-property/python/python_pydantic_free_form_object_property/configuration.py index 2c0d93697a..e6d71ee52b 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-property/python/python_pydantic_free_form_object_property/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-property/python/python_pydantic_free_form_object_property/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-response/python/python_pydantic_free_form_object_response/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-response/python/python_pydantic_free_form_object_response/configuration.py index d4f9fe348d..d8ddafa749 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-response/python/python_pydantic_free_form_object_response/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-free-form-object-response/python/python_pydantic_free_form_object_response/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-list-in-union/python/python_pydantic_list_in_union/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-list-in-union/python/python_pydantic_list_in_union/configuration.py index 7e971548b4..d04311db57 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-list-in-union/python/python_pydantic_list_in_union/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-list-in-union/python/python_pydantic_list_in_union/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-list-response/python/python_pydantic_list_response/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-list-response/python/python_pydantic_list_response/configuration.py index 3f42987e1b..9636e64d7a 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-list-response/python/python_pydantic_list_response/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-list-response/python/python_pydantic_list_response/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-nested-union-with-list-and-str/python/python_pydantic_nested_union_with_list_and_str/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-nested-union-with-list-and-str/python/python_pydantic_nested_union_with_list_and_str/configuration.py index 311e4c3928..e8b1ed1821 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-nested-union-with-list-and-str/python/python_pydantic_nested_union_with_list_and_str/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-nested-union-with-list-and-str/python/python_pydantic_nested_union_with_list_and_str/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-nullable-string/python/python_pydantic_nullable_string/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-nullable-string/python/python_pydantic_nullable_string/configuration.py index 271adb845e..f036909bd0 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-nullable-string/python/python_pydantic_nullable_string/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-nullable-string/python/python_pydantic_nullable_string/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-raw-http-doc-with-top-level-configuration/python/python_pydantic_raw_http_doc_with_top_level_configuration/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-raw-http-doc-with-top-level-configuration/python/python_pydantic_raw_http_doc_with_top_level_configuration/configuration.py index 2c4a632e3c..bb9676af73 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-raw-http-doc-with-top-level-configuration/python/python_pydantic_raw_http_doc_with_top_level_configuration/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-raw-http-doc-with-top-level-configuration/python/python_pydantic_raw_http_doc_with_top_level_configuration/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-recursively-convert-to-models/python/python_pydantic_recursively_convert_to_models/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-recursively-convert-to-models/python/python_pydantic_recursively_convert_to_models/configuration.py index 233d00e9df..62090e541b 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-recursively-convert-to-models/python/python_pydantic_recursively_convert_to_models/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-recursively-convert-to-models/python/python_pydantic_recursively_convert_to_models/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-reserved-namespace-model/python/python_pydantic_reserved_namespace_model/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-reserved-namespace-model/python/python_pydantic_reserved_namespace_model/configuration.py index 774cd02d59..b9c4287e0a 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-reserved-namespace-model/python/python_pydantic_reserved_namespace_model/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-reserved-namespace-model/python/python_pydantic_reserved_namespace_model/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-response-as-param/python/python_pydantic_response_as_param/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-response-as-param/python/python_pydantic_response_as_param/configuration.py index 2e1e8c248f..1a47a777f5 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-response-as-param/python/python_pydantic_response_as_param/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-response-as-param/python/python_pydantic_response_as_param/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py index d01cc19ee2..02a48a7632 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-schema-with-underscores-in-name/python/python_pydantic_schema_with_underscores_in_name/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-schema-with-underscores-in-name/python/python_pydantic_schema_with_underscores_in_name/configuration.py index dc321665ca..8dcefad7b8 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-schema-with-underscores-in-name/python/python_pydantic_schema_with_underscores_in_name/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-schema-with-underscores-in-name/python/python_pydantic_schema_with_underscores_in_name/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-union/python/python_pydantic_union/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-union/python/python_pydantic_union/configuration.py index 37eec5c5dd..d5e2a339d6 100644 --- a/generator/konfig-integration-tests/sdks/python-pydantic-union/python/python_pydantic_union/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-union/python/python_pydantic_union/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-readme-header-snippet/python/python_readme_header_snippet/configuration.py b/generator/konfig-integration-tests/sdks/python-readme-header-snippet/python/python_readme_header_snippet/configuration.py index f8e6367f91..eae14e1c55 100644 --- a/generator/konfig-integration-tests/sdks/python-readme-header-snippet/python/python_readme_header_snippet/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-readme-header-snippet/python/python_readme_header_snippet/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/configuration.py b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/configuration.py index 38f594b630..56867075e7 100644 --- a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/python-union-string-discriminator/python/python_union_string_discriminator/configuration.py b/generator/konfig-integration-tests/sdks/python-union-string-discriminator/python/python_union_string_discriminator/configuration.py index 597a50ec4b..c1ff31e2d3 100644 --- a/generator/konfig-integration-tests/sdks/python-union-string-discriminator/python/python_union_string_discriminator/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-union-string-discriminator/python/python_union_string_discriminator/configuration.py @@ -139,6 +139,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -347,7 +349,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key diff --git a/generator/konfig-integration-tests/sdks/splitit/python-splitit/python/python_splitit_client/configuration.py b/generator/konfig-integration-tests/sdks/splitit/python-splitit/python/python_splitit_client/configuration.py index 9e7792f79b..85623a5cf6 100644 --- a/generator/konfig-integration-tests/sdks/splitit/python-splitit/python/python_splitit_client/configuration.py +++ b/generator/konfig-integration-tests/sdks/splitit/python-splitit/python/python_splitit_client/configuration.py @@ -128,6 +128,8 @@ def __init__(self, host=None, self.api_key_prefix = {} if api_key_prefix: self.api_key_prefix = api_key_prefix + else: + pass """dict to store API prefix (e.g. Bearer) """ self.refresh_api_key_hook = None @@ -345,7 +347,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): if key: prefix = self.api_key_prefix.get(identifier) if prefix: - return "%s %s" % (prefix, key) + return "%s%s" % (prefix, key) else: return key