@@ -681,7 +681,9 @@ private Map<String, Object> buildSupportFileBundle(List<Object> allOperations, L
681
681
bundle .put ("models" , allModels );
682
682
bundle .put ("apiFolder" , config .apiPackage ().replace ('.' , File .separatorChar ));
683
683
bundle .put ("modelPackage" , config .modelPackage ());
684
- List <CodegenSecurity > authMethods = config .fromSecurity (openAPI .getComponents ().getSecuritySchemes ());
684
+
685
+ final Map <String , SecurityScheme > securitySchemeMap = openAPI .getComponents () != null ? openAPI .getComponents ().getSecuritySchemes () : null ;
686
+ final List <CodegenSecurity > authMethods = config .fromSecurity (securitySchemeMap );
685
687
if (authMethods != null && !authMethods .isEmpty ()) {
686
688
bundle .put ("authMethods" , authMethods );
687
689
bundle .put ("hasAuthMethods" , true );
@@ -843,14 +845,15 @@ private void processOperation(String resourcePath, String httpMethod, Operation
843
845
}
844
846
}
845
847
848
+ final Map <String , Schema > schemas = openAPI .getComponents () != null ? openAPI .getComponents ().getSchemas () : null ;
849
+ final Map <String , SecurityScheme > securitySchemes = openAPI .getComponents () != null ? openAPI .getComponents ().getSecuritySchemes () : null ;
850
+ final List <SecurityRequirement > globalSecurities = openAPI .getSecurity ();
846
851
for (Tag tag : tags ) {
847
852
try {
848
- CodegenOperation codegenOperation = config .fromOperation (resourcePath , httpMethod , operation , openAPI . getComponents (). getSchemas () , openAPI );
853
+ CodegenOperation codegenOperation = config .fromOperation (resourcePath , httpMethod , operation , schemas , openAPI );
849
854
codegenOperation .tags = new ArrayList <>(tags );
850
855
config .addOperationToGroup (config .sanitizeTag (tag .getName ()), resourcePath , operation , codegenOperation , operations );
851
856
852
- final Map <String , SecurityScheme > securitySchemes = openAPI .getComponents ().getSecuritySchemes ();
853
- List <SecurityRequirement > globalSecurities = openAPI .getSecurity ();
854
857
List <SecurityRequirement > securities = operation .getSecurity ();
855
858
if (securities != null && securities .isEmpty ()) {
856
859
continue ;
0 commit comments