forked from loafle/openapi-generator-original
Allow null title, as in Kubernetes Swagger Spec
This commit is contained in:
parent
512e51777d
commit
569d458bc9
@ -181,9 +181,13 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
|
|||||||
String title = swagger.getInfo().getTitle();
|
String title = swagger.getInfo().getTitle();
|
||||||
|
|
||||||
// Drop any API suffix
|
// Drop any API suffix
|
||||||
title = title.trim();
|
if(title == null) {
|
||||||
if (title.toUpperCase().endsWith("API")) {
|
title = "Swagger";
|
||||||
title = title.substring(0, title.length() - 3);
|
} else {
|
||||||
|
title = title.trim();
|
||||||
|
if (title.toUpperCase().endsWith("API")) {
|
||||||
|
title = title.substring(0, title.length() - 3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] words = title.split(" ");
|
String[] words = title.split(" ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user