From 79e83eed87a42ba8e6afdffc4ad7ae03c5c57689 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 23 Sep 2020 19:01:39 +0800 Subject: [PATCH 1/6] add option to set recursion limit --- .../codegen/languages/PythonClientCodegen.java | 11 +++++++++++ .../main/resources/python/__init__package.mustache | 4 ++++ .../python-experimental/__init__package.mustache | 6 +++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index dffc0c62a192..88c6106642d0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -43,6 +43,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig public static final String DEFAULT_LIBRARY = "urllib3"; // nose is a python testing framework, we use pytest if USE_NOSE is unset public static final String USE_NOSE = "useNose"; + public static final String SET_RECURSION_LIMIT = "setRecursionLimit"; protected String packageName = "openapi_client"; protected String packageVersion = "1.0.0"; @@ -184,6 +185,7 @@ public PythonClientCodegen() { .defaultValue(Boolean.FALSE.toString())); cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(SET_RECURSION_LIMIT, "Set recursion limit. If not, using the system default value.")); supportedLibraries.put("urllib3", "urllib3-based client"); supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); @@ -253,6 +255,15 @@ public void processOpts() { setUseNose((String) additionalProperties.get(USE_NOSE)); } + // check to see if setRecursionLimit is set and whether it's an integer + if (additionalProperties.containsKey(SET_RECURSION_LIMIT)) { + try { + Integer.parseInt((String)additionalProperties.get(SET_RECURSION_LIMIT)); + } catch(NumberFormatException | NullPointerException e) { + throw new IllegalArgumentException("setRecursionLimit must be an integer, e.g. 2000."); + } + } + String readmePath = "README.md"; String readmeTemplate = "README.mustache"; if (generateSourceCodeOnly) { diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache index aee16448ad8a..bd900c1353c6 100644 --- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache @@ -23,3 +23,7 @@ from {{packageName}}.exceptions import ApiException # import models into sdk package {{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}} {{/model}}{{/models}} +{{#setRecursionLimit}} + +__import__('sys').setrecursionlimit({{{.}}}) +{{/setRecursionLimit}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache index d0746d3aa687..2d9f4c1d507a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache @@ -21,4 +21,8 @@ from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiTypeError from {{packageName}}.exceptions import ApiValueError from {{packageName}}.exceptions import ApiKeyError -from {{packageName}}.exceptions import ApiException \ No newline at end of file +from {{packageName}}.exceptions import ApiException +{{#setRecursionLimit}} + +__import__('sys').setrecursionlimit({{{.}}}) +{{/setRecursionLimit}} From dd246daf8888b1430b6ed83ad15d1190a8b6192b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 23 Sep 2020 22:11:03 +0800 Subject: [PATCH 2/6] fix test failure --- .../codegen/options/PythonClientOptionsProvider.java | 2 ++ .../petstore/python-experimental/petstore_api/__init__.py | 2 +- .../python-experimental/x_auth_id_alias/__init__.py | 2 +- .../python-experimental/dynamic_servers/__init__.py | 2 +- .../petstore/python-experimental/petstore_api/__init__.py | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java index f3ef0cd3d54c..1ff692b023c6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java @@ -29,6 +29,7 @@ public class PythonClientOptionsProvider implements OptionsProvider { public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String PACKAGE_URL_VALUE = ""; public static final String USE_NOSE_VALUE = "false"; + public static final String SET_RECURSION_LIMIT = "1200"; @Override public String getLanguage() { @@ -47,6 +48,7 @@ public Map createOptions() { .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") .put(CodegenConstants.LIBRARY, "urllib3") .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE) + .put(PythonClientCodegen.SET_RECURSION_LIMIT, SET_RECURSION_LIMIT) .build(); } diff --git a/samples/client/petstore/python-experimental/petstore_api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/__init__.py index bd7096a81818..50dbde60cc5a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/__init__.py @@ -26,4 +26,4 @@ from petstore_api.exceptions import ApiTypeError from petstore_api.exceptions import ApiValueError from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException \ No newline at end of file +from petstore_api.exceptions import ApiException diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py index 2003cfda7c10..e041974817db 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py @@ -26,4 +26,4 @@ from x_auth_id_alias.exceptions import ApiTypeError from x_auth_id_alias.exceptions import ApiValueError from x_auth_id_alias.exceptions import ApiKeyError -from x_auth_id_alias.exceptions import ApiException \ No newline at end of file +from x_auth_id_alias.exceptions import ApiException diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py index b7f955894f8d..64364080b716 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py @@ -26,4 +26,4 @@ from dynamic_servers.exceptions import ApiTypeError from dynamic_servers.exceptions import ApiValueError from dynamic_servers.exceptions import ApiKeyError -from dynamic_servers.exceptions import ApiException \ No newline at end of file +from dynamic_servers.exceptions import ApiException diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py index db9beb2ebfb0..29e1c95c65a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -27,4 +27,4 @@ from petstore_api.exceptions import ApiTypeError from petstore_api.exceptions import ApiValueError from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException \ No newline at end of file +from petstore_api.exceptions import ApiException From 5908af0ca2376f9e6632d0c23d7845915d9820b6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 23 Sep 2020 22:50:47 +0800 Subject: [PATCH 3/6] update doc --- docs/generators/python-experimental.md | 1 + docs/generators/python.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index dbb7bbbd5af1..fa9bfa3c220b 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -12,6 +12,7 @@ sidebar_label: python-experimental |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| +|setRecursionLimit|Set recursion limit. If not, using the system default value.| |null| |useNose|use the nose test framework| |false| ## IMPORT MAPPING diff --git a/docs/generators/python.md b/docs/generators/python.md index e1361952bb69..4c6310660ac2 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -12,6 +12,7 @@ sidebar_label: python |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| +|setRecursionLimit|Set recursion limit. If not, using the system default value.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |useNose|use the nose test framework| |false| From 236a50cd66597ec4e51d9694273bc01c83e2c8ac Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 24 Sep 2020 00:03:13 +0800 Subject: [PATCH 4/6] add tests --- bin/configs/python-experimental.yaml | 1 + docs/generators/python-experimental.md | 2 +- docs/generators/python.md | 2 +- .../codegen/languages/PythonClientCodegen.java | 2 +- .../petstore/python-experimental/petstore_api/__init__.py | 2 ++ .../python-experimental/tests_manual/test_fake_api.py | 6 ++++++ .../python-experimental/tests_manual/test_shape.py | 7 +++++++ 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml index 58aeadafa2c2..c539826ca4cb 100644 --- a/bin/configs/python-experimental.yaml +++ b/bin/configs/python-experimental.yaml @@ -4,3 +4,4 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/ templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: packageName: petstore_api + setRecursionLimit: "1234" diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index fa9bfa3c220b..05a934736d3c 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -12,7 +12,7 @@ sidebar_label: python-experimental |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| -|setRecursionLimit|Set recursion limit. If not, using the system default value.| |null| +|setRecursionLimit|Set recursion limit. If not set, use the system default value.| |null| |useNose|use the nose test framework| |false| ## IMPORT MAPPING diff --git a/docs/generators/python.md b/docs/generators/python.md index 4c6310660ac2..46fc8d11ce05 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -12,7 +12,7 @@ sidebar_label: python |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| -|setRecursionLimit|Set recursion limit. If not, using the system default value.| |null| +|setRecursionLimit|Set recursion limit. If not set, use the system default value.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |useNose|use the nose test framework| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 88c6106642d0..6277eb424d08 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -185,7 +185,7 @@ public PythonClientCodegen() { .defaultValue(Boolean.FALSE.toString())); cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(SET_RECURSION_LIMIT, "Set recursion limit. If not, using the system default value.")); + cliOptions.add(new CliOption(SET_RECURSION_LIMIT, "Set recursion limit. If not set, use the system default value.")); supportedLibraries.put("urllib3", "urllib3-based client"); supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py index 29e1c95c65a0..1605d7d67c05 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -28,3 +28,5 @@ from petstore_api.exceptions import ApiValueError from petstore_api.exceptions import ApiKeyError from petstore_api.exceptions import ApiException + +__import__('sys').setrecursionlimit(1234) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py index 60dcbd549df9..b089c1d2d082 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py @@ -98,6 +98,12 @@ def test_boolean(self): assert endpoint.openapi_types['body'] == (bool,) assert endpoint.settings['response_type'] == (bool,) + def test_setrecursionlimit(self): + """Test case for setrecursionlimit + + """ + assert sys.getrecursionlimit() == 1234 + def test_fake_health_get(self): """Test case for fake_health_get diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py index d4240f695300..667066c29331 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py @@ -36,6 +36,12 @@ def setUp(self): def tearDown(self): pass + def test_setrecursionlimit(self): + """Test case for setrecursionlimit + + """ + assert sys.getrecursionlimit() == 1234 + def testShape(self): """Test Shape""" from petstore_api.model import complex_quadrilateral @@ -43,6 +49,7 @@ def testShape(self): from petstore_api.model import equilateral_triangle from petstore_api.model import isosceles_triangle from petstore_api.model import scalene_triangle + tri = triangle.Triangle( shape_type="Triangle", triangle_type="EquilateralTriangle" From d92f2439dfeb47e0923d9d7f7ee8c3acb1cbcda0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 24 Sep 2020 00:42:12 +0800 Subject: [PATCH 5/6] add missing import --- .../petstore/python-experimental/tests_manual/test_fake_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py index b089c1d2d082..4095651f94f0 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py @@ -9,6 +9,7 @@ Generated by: https://openapi-generator.tech """ +import sys from collections import namedtuple import unittest import json From d84cdc50619e7284eb7c9ddc4d28ac0e3b143f06 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 25 Sep 2020 00:15:15 +0800 Subject: [PATCH 6/6] rename option to recursionLimit --- bin/configs/python-experimental.yaml | 2 +- docs/generators/python-experimental.md | 2 +- docs/generators/python.md | 2 +- .../codegen/languages/PythonClientCodegen.java | 10 +++++----- .../src/main/resources/python/__init__package.mustache | 4 ++-- .../python-experimental/__init__package.mustache | 4 ++-- .../codegen/options/PythonClientOptionsProvider.java | 4 ++-- .../python-experimental/tests_manual/test_fake_api.py | 4 ++-- .../python-experimental/tests_manual/test_shape.py | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml index c539826ca4cb..9e06973b1d44 100644 --- a/bin/configs/python-experimental.yaml +++ b/bin/configs/python-experimental.yaml @@ -4,4 +4,4 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/ templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: packageName: petstore_api - setRecursionLimit: "1234" + recursionLimit: "1234" diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 05a934736d3c..c063b96dec8d 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -12,7 +12,7 @@ sidebar_label: python-experimental |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| -|setRecursionLimit|Set recursion limit. If not set, use the system default value.| |null| +|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| |useNose|use the nose test framework| |false| ## IMPORT MAPPING diff --git a/docs/generators/python.md b/docs/generators/python.md index 46fc8d11ce05..a56aa1530ed4 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -12,7 +12,7 @@ sidebar_label: python |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| -|setRecursionLimit|Set recursion limit. If not set, use the system default value.| |null| +|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |useNose|use the nose test framework| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 6277eb424d08..a4061c84de6f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -43,7 +43,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig public static final String DEFAULT_LIBRARY = "urllib3"; // nose is a python testing framework, we use pytest if USE_NOSE is unset public static final String USE_NOSE = "useNose"; - public static final String SET_RECURSION_LIMIT = "setRecursionLimit"; + public static final String RECURSION_LIMIT = "recursionLimit"; protected String packageName = "openapi_client"; protected String packageVersion = "1.0.0"; @@ -185,7 +185,7 @@ public PythonClientCodegen() { .defaultValue(Boolean.FALSE.toString())); cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(SET_RECURSION_LIMIT, "Set recursion limit. If not set, use the system default value.")); + cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); supportedLibraries.put("urllib3", "urllib3-based client"); supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); @@ -256,11 +256,11 @@ public void processOpts() { } // check to see if setRecursionLimit is set and whether it's an integer - if (additionalProperties.containsKey(SET_RECURSION_LIMIT)) { + if (additionalProperties.containsKey(RECURSION_LIMIT)) { try { - Integer.parseInt((String)additionalProperties.get(SET_RECURSION_LIMIT)); + Integer.parseInt((String)additionalProperties.get(RECURSION_LIMIT)); } catch(NumberFormatException | NullPointerException e) { - throw new IllegalArgumentException("setRecursionLimit must be an integer, e.g. 2000."); + throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000."); } } diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache index bd900c1353c6..f81dd5735fa9 100644 --- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache @@ -23,7 +23,7 @@ from {{packageName}}.exceptions import ApiException # import models into sdk package {{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}} {{/model}}{{/models}} -{{#setRecursionLimit}} +{{#recursionLimit}} __import__('sys').setrecursionlimit({{{.}}}) -{{/setRecursionLimit}} +{{/recursionLimit}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache index 2d9f4c1d507a..d7ff5b826025 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache @@ -22,7 +22,7 @@ from {{packageName}}.exceptions import ApiTypeError from {{packageName}}.exceptions import ApiValueError from {{packageName}}.exceptions import ApiKeyError from {{packageName}}.exceptions import ApiException -{{#setRecursionLimit}} +{{#recursionLimit}} __import__('sys').setrecursionlimit({{{.}}}) -{{/setRecursionLimit}} +{{/recursionLimit}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java index 1ff692b023c6..551582d0f031 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java @@ -29,7 +29,7 @@ public class PythonClientOptionsProvider implements OptionsProvider { public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String PACKAGE_URL_VALUE = ""; public static final String USE_NOSE_VALUE = "false"; - public static final String SET_RECURSION_LIMIT = "1200"; + public static final String RECURSION_LIMIT = "1200"; @Override public String getLanguage() { @@ -48,7 +48,7 @@ public Map createOptions() { .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") .put(CodegenConstants.LIBRARY, "urllib3") .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE) - .put(PythonClientCodegen.SET_RECURSION_LIMIT, SET_RECURSION_LIMIT) + .put(PythonClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) .build(); } diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py index 4095651f94f0..89695137c6e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py @@ -99,8 +99,8 @@ def test_boolean(self): assert endpoint.openapi_types['body'] == (bool,) assert endpoint.settings['response_type'] == (bool,) - def test_setrecursionlimit(self): - """Test case for setrecursionlimit + def test_recursionlimit(self): + """Test case for recursionlimit """ assert sys.getrecursionlimit() == 1234 diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py index 667066c29331..a2b59fc6f31c 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py @@ -36,8 +36,8 @@ def setUp(self): def tearDown(self): pass - def test_setrecursionlimit(self): - """Test case for setrecursionlimit + def test_recursionlimit(self): + """Test case for recursionlimit """ assert sys.getrecursionlimit() == 1234