From c02fc812fe3dff0c207bfd87fa991a2eb293a800 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 20 Nov 2020 11:54:16 +0800 Subject: [PATCH] add warning about unsupported libraries in python client generator (#7981) --- .../openapitools/codegen/languages/PythonClientCodegen.java | 5 +++++ 1 file changed, 5 insertions(+) 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 000079412505..5b91b6bb5cd2 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 @@ -150,6 +150,11 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { attrNoneIfUnset = Boolean.valueOf(additionalProperties.get(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET).toString()); } additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset); + + // check library option to ensure only urllib3 is supported + if (!DEFAULT_LIBRARY.equals(getLibrary())) { + throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `pyhton` client generator."); + } } /**