handle type null example properly

This commit is contained in:
William Cheng 2020-05-22 13:31:16 +08:00
parent f10de73ed5
commit 26c0d991c0

View File

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