mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 23:20:52 +00:00
added null check for simple definitions with no models
This commit is contained in:
parent
caaa753f58
commit
2ed8e10fe4
@ -71,6 +71,7 @@ public class DefaultGenerator implements Generator {
|
|||||||
|
|
||||||
// models
|
// models
|
||||||
Map<String, Model> definitions = swagger.getDefinitions();
|
Map<String, Model> definitions = swagger.getDefinitions();
|
||||||
|
if(definitions != null) {
|
||||||
for(String name: definitions.keySet()) {
|
for(String name: definitions.keySet()) {
|
||||||
Model model = definitions.get(name);
|
Model model = definitions.get(name);
|
||||||
Map<String, Model> modelMap = new HashMap<String, Model>();
|
Map<String, Model> modelMap = new HashMap<String, Model>();
|
||||||
@ -95,6 +96,7 @@ public class DefaultGenerator implements Generator {
|
|||||||
writeToFile(filename, tmpl.execute(models));
|
writeToFile(filename, tmpl.execute(models));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(System.getProperty("debugModels") != null) {
|
if(System.getProperty("debugModels") != null) {
|
||||||
System.out.println("############ Model info ############");
|
System.out.println("############ Model info ############");
|
||||||
Json.prettyPrint(allModels);
|
Json.prettyPrint(allModels);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user