forked from loafle/openapi-generator-original
Fix NullPointerException when the oauth flow is missing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user