@@ -710,7 +710,7 @@ public void postProcessParameter(CodegenParameter parameter) {
710
710
//override with any special handling of the entire OpenAPI spec document
711
711
@ SuppressWarnings ("unused" )
712
712
public void preprocessOpenAPI (OpenAPI openAPI ) {
713
- if (useOneOfInterfaces ) {
713
+ if (useOneOfInterfaces && openAPI . getComponents () != null ) {
714
714
// we process the openapi schema here to find oneOf schemas and create interface models for them
715
715
Map <String , Schema > schemas = new HashMap <String , Schema >(openAPI .getComponents ().getSchemas ());
716
716
if (schemas == null ) {
@@ -733,11 +733,13 @@ public void preprocessOpenAPI(OpenAPI openAPI) {
733
733
schemas .put (opId , requestSchema );
734
734
}
735
735
// process all response bodies
736
- for (Map .Entry <String , ApiResponse > ar : op .getValue ().getResponses ().entrySet ()) {
737
- ApiResponse a = ModelUtils .getReferencedApiResponse (openAPI , ar .getValue ());
738
- Schema responseSchema = ModelUtils .getSchemaFromResponse (a );
739
- if (responseSchema != null ) {
740
- schemas .put (opId + ar .getKey (), responseSchema );
736
+ if (op .getValue ().getResponses () != null ){
737
+ for (Map .Entry <String , ApiResponse > ar : op .getValue ().getResponses ().entrySet ()) {
738
+ ApiResponse a = ModelUtils .getReferencedApiResponse (openAPI , ar .getValue ());
739
+ Schema responseSchema = ModelUtils .getSchemaFromResponse (a );
740
+ if (responseSchema != null ) {
741
+ schemas .put (opId + ar .getKey (), responseSchema );
742
+ }
741
743
}
742
744
}
743
745
}
0 commit comments