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";