diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 6581e603ad5..7fdcd894277 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -271,6 +271,15 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) +{{#hasHttpSignatureMethods}} + if name == "signing_info" and value is not None: + # Ensure the host paramater from signing info is the same as + # Configuration.host. + value.host = self.host +{{/hasHttpSignatureMethods}} + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 025188fd17d..ef96f1bc5cd 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -195,6 +195,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 03ac961e1d2..066665d16fc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 03ac961e1d2..066665d16fc 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 03ac961e1d2..066665d16fc 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index d68709a5d81..d885572339e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -246,6 +246,13 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == "signing_info" and value is not None: + # Ensure the host paramater from signing info is the same as + # Configuration.host. + value.host = self.host + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 994d4c73fbb..d0d05b11381 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration.