@@ -497,6 +497,8 @@ public int compare(CodegenOperation one, CodegenOperation another) {
497
497
});
498
498
Map <String , Object > operation = processOperations (config , tag , ops , allModels );
499
499
500
+ processSecurityProperties (operation );
501
+
500
502
operation .put ("basePath" , basePath );
501
503
operation .put ("basePathWithoutHost" , basePathWithoutHost );
502
504
operation .put ("contextPath" , contextPath );
@@ -743,12 +745,8 @@ private Map<String, Object> buildSupportFileBundle(List<Object> allOperations, L
743
745
bundle .put ("apiFolder" , config .apiPackage ().replace ('.' , File .separatorChar ));
744
746
bundle .put ("modelPackage" , config .modelPackage ());
745
747
746
- final Map <String , SecurityScheme > securitySchemeMap = openAPI .getComponents () != null ? openAPI .getComponents ().getSecuritySchemes () : null ;
747
- final List <CodegenSecurity > authMethods = config .fromSecurity (securitySchemeMap );
748
- if (authMethods != null && !authMethods .isEmpty ()) {
749
- bundle .put ("authMethods" , authMethods );
750
- bundle .put ("hasAuthMethods" , true );
751
- }
748
+ processSecurityProperties (bundle );
749
+
752
750
if (openAPI .getExternalDocs () != null ) {
753
751
bundle .put ("externalDocs" , openAPI .getExternalDocs ());
754
752
}
@@ -1136,4 +1134,14 @@ private Boolean getCustomOptionBooleanValue(String option) {
1136
1134
}
1137
1135
return Boolean .valueOf (optionalCodegenArgument .get ().getValue ());
1138
1136
}
1137
+
1138
+ protected void processSecurityProperties (Map <String , Object > bundle ) {
1139
+ final Map <String , SecurityScheme > securitySchemeMap = openAPI .getComponents () != null ? openAPI .getComponents ().getSecuritySchemes () : null ;
1140
+ final List <CodegenSecurity > authMethods = config .fromSecurity (securitySchemeMap );
1141
+ if (authMethods != null && !authMethods .isEmpty ()) {
1142
+ bundle .put ("authMethods" , authMethods );
1143
+ bundle .put ("hasAuthMethods" , true );
1144
+ }
1145
+ }
1146
+
1139
1147
}
0 commit comments