Fix NullPointerException when the oauth flow is missing

This commit is contained in:
Cédric Luthi
2016-09-21 00:48:16 +02:00
parent 6ac5a2c306
commit 72058c2638

View File

@@ -2455,6 +2455,9 @@ public class DefaultCodegen {
sec.isKeyInHeader = sec.isKeyInQuery = sec.isApiKey = sec.isBasic = false;
sec.isOAuth = true;
sec.flow = oauth2Definition.getFlow();
if (sec.flow == null) {
throw new RuntimeException("missing oauth flow in " + sec.name);
}
switch(sec.flow) {
case "accessCode":
sec.isCode = true;