Merge pull request #3840 from 0xced/fix-oauth-flow-npe

Fix NullPointerException when the oauth flow is missing
This commit is contained in:
wing328 2016-09-21 10:39:52 +08:00 committed by GitHub
commit ff90954dc6

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;