@@ -4849,10 +4849,13 @@ public List<CodegenSecurity> fromSecurity(Map<String, SecurityScheme> securitySc
4849
4849
// This scheme may have to be changed when it is officially registered with IANA.
4850
4850
cs .isHttpSignature = true ;
4851
4851
once (LOGGER ).warn ("Security scheme 'HTTP signature' is a draft IETF RFC and subject to change." );
4852
+ } else {
4853
+ once (LOGGER ).warn ("Unknown scheme `{}` found in the HTTP security definition." , securityScheme .getScheme ());
4852
4854
}
4853
4855
codegenSecurities .add (cs );
4854
4856
} else if (SecurityScheme .Type .OAUTH2 .equals (securityScheme .getType ())) {
4855
4857
final OAuthFlows flows = securityScheme .getFlows ();
4858
+ boolean isFlowEmpty = true ;
4856
4859
if (securityScheme .getFlows () == null ) {
4857
4860
throw new RuntimeException ("missing oauth flow in " + key );
4858
4861
}
@@ -4862,28 +4865,38 @@ public List<CodegenSecurity> fromSecurity(Map<String, SecurityScheme> securitySc
4862
4865
cs .isPassword = true ;
4863
4866
cs .flow = "password" ;
4864
4867
codegenSecurities .add (cs );
4868
+ isFlowEmpty = false ;
4865
4869
}
4866
4870
if (flows .getImplicit () != null ) {
4867
4871
final CodegenSecurity cs = defaultOauthCodegenSecurity (key , securityScheme );
4868
4872
setOauth2Info (cs , flows .getImplicit ());
4869
4873
cs .isImplicit = true ;
4870
4874
cs .flow = "implicit" ;
4871
4875
codegenSecurities .add (cs );
4876
+ isFlowEmpty = false ;
4872
4877
}
4873
4878
if (flows .getClientCredentials () != null ) {
4874
4879
final CodegenSecurity cs = defaultOauthCodegenSecurity (key , securityScheme );
4875
4880
setOauth2Info (cs , flows .getClientCredentials ());
4876
4881
cs .isApplication = true ;
4877
4882
cs .flow = "application" ;
4878
4883
codegenSecurities .add (cs );
4884
+ isFlowEmpty = false ;
4879
4885
}
4880
4886
if (flows .getAuthorizationCode () != null ) {
4881
4887
final CodegenSecurity cs = defaultOauthCodegenSecurity (key , securityScheme );
4882
4888
setOauth2Info (cs , flows .getAuthorizationCode ());
4883
4889
cs .isCode = true ;
4884
4890
cs .flow = "accessCode" ;
4885
4891
codegenSecurities .add (cs );
4892
+ isFlowEmpty = false ;
4893
+ }
4894
+
4895
+ if (isFlowEmpty ) {
4896
+ once (LOGGER ).error ("Invalid flow definition defined in the security scheme: {}" , flows );
4886
4897
}
4898
+ } else {
4899
+ once (LOGGER ).error ("Unknown type `{}` found in the security definition `{}`." , securityScheme .getType (), securityScheme .getName ());
4887
4900
}
4888
4901
}
4889
4902
0 commit comments