mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Merge pull request #3840 from 0xced/fix-oauth-flow-npe
Fix NullPointerException when the oauth flow is missing
This commit is contained in:
commit
ff90954dc6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user