diff --git a/src/main/java/com/twilio/oai/DirectoryStructureService.java b/src/main/java/com/twilio/oai/DirectoryStructureService.java index 94d5376a9..339eda529 100644 --- a/src/main/java/com/twilio/oai/DirectoryStructureService.java +++ b/src/main/java/com/twilio/oai/DirectoryStructureService.java @@ -249,14 +249,15 @@ public List processOperations(final OperationsMap results) { final String version = PathUtils.getFirstPathPart(firstOperation.path); for(CodegenOperation co : operations){ - for(Map map : co.produces){ - Map.Entry firstEntry = map.entrySet().iterator().next(); - List> successProduce = new ArrayList<>(); - Map successMap = new HashMap<>(); - successMap.put(firstEntry.getKey(), firstEntry.getValue()); - successProduce.add(successMap); - co.vendorExtensions.put("successProduce", successProduce); - break; + if(co.produces != null) + for(Map map : co.produces){ + Map.Entry firstEntry = map.entrySet().iterator().next(); + List> successProduce = new ArrayList<>(); + Map successMap = new HashMap<>(); + successMap.put(firstEntry.getKey(), firstEntry.getValue()); + successProduce.add(successMap); + co.vendorExtensions.put("successProduce", successProduce); + break; } }