From 43e3f0f9e8b6317a7fbf738eed0fa1543896c0d8 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 20 Mar 2022 10:11:19 +0800 Subject: [PATCH] fix the exception in python flask option handling --- .../languages/AbstractPythonConnexionServerCodegen.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java index b9ddac1fecd0..dc265c915408 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java @@ -179,16 +179,16 @@ public void processOpts() { typeMapping.put("long", "long"); } if (additionalProperties.containsKey(FEATURE_CORS)) { - setFeatureCORS((String) additionalProperties.get(FEATURE_CORS)); + setFeatureCORS(String.valueOf(additionalProperties.get(FEATURE_CORS))); } if (additionalProperties.containsKey(USE_NOSE)) { - setUseNose((String) additionalProperties.get(USE_NOSE)); + setUseNose(String.valueOf(additionalProperties.get(USE_NOSE))); } if (additionalProperties.containsKey(USE_PYTHON_SRC_ROOT_IN_IMPORTS)) { - setUsePythonSrcRootInImports((String) additionalProperties.get(USE_PYTHON_SRC_ROOT_IN_IMPORTS)); + setUsePythonSrcRootInImports(String.valueOf(additionalProperties.get(USE_PYTHON_SRC_ROOT_IN_IMPORTS))); } if (additionalProperties.containsKey(MOVE_TESTS_UNDER_PYTHON_SRC_ROOT)) { - setMoveTestsUnderPythonSrcRoot((String) additionalProperties.get(MOVE_TESTS_UNDER_PYTHON_SRC_ROOT)); + setMoveTestsUnderPythonSrcRoot(String.valueOf(additionalProperties.get(MOVE_TESTS_UNDER_PYTHON_SRC_ROOT))); } if (additionalProperties.containsKey(PYTHON_SRC_ROOT)) { String pythonSrcRoot = (String) additionalProperties.get(PYTHON_SRC_ROOT);