Skip to content

Commit

Permalink
Added lost http methods (#1248)
Browse files Browse the repository at this point in the history
Fixed #1246
  • Loading branch information
altro3 committed Oct 12, 2023
1 parent 9589897 commit e0a7893
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,29 @@ public static Operation getOperationOnPathItem(PathItem pathItem, HttpMethod htt

return switch (httpMethod) {
case GET -> pathItem.getGet();
case POST -> pathItem.getPost();
case PUT -> pathItem.getPut();
case PATCH -> pathItem.getPatch();
case POST -> pathItem.getPost();
case DELETE -> pathItem.getDelete();
case HEAD -> pathItem.getHead();
case OPTIONS -> pathItem.getOptions();
case HEAD -> pathItem.getHead();
case PATCH -> pathItem.getPatch();
case TRACE -> pathItem.getTrace();
default -> null;
};
}

public static void setOperationOnPathItem(PathItem pathItem, HttpMethod httpMethod, Operation operation) {
if (pathItem == null) {
return;
}
switch (httpMethod) {
case GET -> pathItem.setGet(operation);
case POST -> pathItem.setPost(operation);
case PUT -> pathItem.setPut(operation);
case POST -> pathItem.setPost(operation);
case DELETE -> pathItem.setDelete(operation);
case OPTIONS -> pathItem.setOptions(operation);
case HEAD -> pathItem.setHead(operation);
case PATCH -> pathItem.setPatch(operation);
case TRACE -> pathItem.setTrace(operation);
default -> {
// do nothing
}
Expand Down

0 comments on commit e0a7893

Please sign in to comment.