mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
update sample, better handle of $ in naming
This commit is contained in:
parent
eebb6c4dd0
commit
792726ddc5
@ -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");
|
||||
|
Binary file not shown.
@ -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))
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user