Skip to content

Commit 1a15239

Browse files
committed
skip operations with a request body with no supported MIME type
Signed-off-by: Grant Linville <[email protected]>
1 parent 6aeb06b commit 1a15239

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/loader/openapi.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost string) ([]types.Tool, error) {
6666
}
6767
}
6868

69+
operations:
6970
for method, operation := range pathObj.Operations() {
7071
// Handle operation-level server override, if one exists
7172
operationServer := pathServer
@@ -170,6 +171,11 @@ func getOpenAPITools(t *openapi3.T, defaultHost string) ([]types.Tool, error) {
170171
tool.Parameters.Arguments.Properties["requestBodyContent"] = &openapi3.SchemaRef{Value: arg}
171172
break
172173
}
174+
175+
if bodyMIME == "" {
176+
// No supported MIME types found, so just skip this operation and move on.
177+
continue operations
178+
}
173179
}
174180

175181
// See if there is any auth defined for this operation

0 commit comments

Comments
 (0)