Fix printing empty notes (#15238)

This commit is contained in:
André Andersson 2023-04-17 08:42:30 +02:00 committed by GitHub
parent 70a6106626
commit 096aabd360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,6 +373,10 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
response.isModel = !response.primitiveType;
}
});
// an empty string is truthy so we explicitly set empty notes to null
// So we don't print empty notes
if (op.notes != null && op.notes.isEmpty())
op.notes = null;
});
final boolean includeTime = anyOperationResponse(ops, response -> response.isDate || response.isDateTime) ||