From 26c0d991c0975669eb93f727e8c1df9be96da28c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 May 2020 13:31:16 +0800 Subject: [PATCH] handle type null example properly --- .../org/openapitools/codegen/languages/PythonClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 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 ef92f7ce0db..257a315a71a 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 @@ -710,7 +710,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig for (int i=0 ; i< indentation ; i++) indentation_string += " "; String example = super.toExampleValue(schema); - if (ModelUtils.isNullType(schema) && null != example) { + if (ModelUtils.isNullType(schema)) { // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, // though this tooling supports it. return "None";