diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index ad8fbc683f..2722a93b3c 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -173,6 +173,9 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig // sanitize name name = sanitizeName(name); + // remove dollar sign + name = name.replaceAll("$", ""); + // if it's all uppper case, convert to lower case if (name.matches("^[A-Z_]*$")) { name = name.toLowerCase(); @@ -203,6 +206,9 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig public String toModelName(String name) { name = sanitizeName(name); + // remove dollar sign + name = name.replaceAll("$", ""); + // model name cannot use reserved keyword, e.g. return if (reservedWords.contains(name)) { throw new RuntimeException(name + " (reserved word) cannot be used as a model name"); diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage index d58a8fe9c6..03f8b2a2d0 100644 Binary files a/samples/client/petstore/python/.coverage and b/samples/client/petstore/python/.coverage differ diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log index 9394a72403..0d8dcbb583 100644 --- a/samples/client/petstore/python/dev-requirements.txt.log +++ b/samples/client/petstore/python/dev-requirements.txt.log @@ -13,3 +13,10 @@ Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) Using cached pluggy-0.3.0-py2.py3-none-any.whl Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize Successfully installed coverage-3.7.1 nose-1.3.7 pluggy-0.3.0 py-1.4.30 randomize-0.13 tox-2.1.1 virtualenv-13.1.2 +Requirement already satisfied (use --upgrade to upgrade): nose in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) diff --git a/samples/client/petstore/python/swagger_client/configuration.py b/samples/client/petstore/python/swagger_client/configuration.py index 122a347b3a..ecbecf7e9f 100644 --- a/samples/client/petstore/python/swagger_client/configuration.py +++ b/samples/client/petstore/python/swagger_client/configuration.py @@ -72,6 +72,10 @@ class Configuration(object): # Password for HTTP basic authentication self.password = "" + # access token for OAuth + self.access_token = "" + + # Logging Settings self.logger = {} self.logger["package_logger"] = logging.getLogger("swagger_client")