Skip to content

Commit 0fbf8d8

Browse files
committed
added check, warning for missing http method swagger-api/swagger-codegen#612
1 parent 0dfdafc commit 0fbf8d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,12 @@ else if(resourceListing.getApiVersion() != null) {
478478
}
479479
for(io.swagger.models.apideclaration.Operation op : ops) {
480480
Operation operation = convertOperation(tag, op);
481-
path.set(op.getMethod().toString().toLowerCase(), operation);
481+
if(op.getMethod() != null) {
482+
path.set(op.getMethod().toString().toLowerCase(), operation);
483+
}
484+
else {
485+
System.out.println("skipping operation with missing method:\n" + Json.pretty(operation));
486+
}
482487
}
483488
}
484489

0 commit comments

Comments
 (0)