Skip to content

Commit caba0c0

Browse files
cpoderclaude
andcommitted
Fix OpenAPI provider generation and doc retrieval (v1.6.1)
Fixes based on decompiling wm.server.openapi:generateProvider: - Both sourceUri AND openapiUrl are required (not just one) - For inline specs: set both to "inline" and pass openapiContent - IS cannot fetch remote URLs reliably -- recommend downloading the spec externally and passing content inline - Supports both JSON and YAML OpenAPI 3.0 specs (both tested E2E) - Fixed getOpenAPIDoc to include openapi.json format parameter Updated tool descriptions with correct usage guidance. Full E2E: create folder -> generate from inline JSON spec -> retrieve OpenAPI doc -> cleanup. 151/151 E2E tests passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 48de4ae commit caba0c0

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

mcp-server-rs/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mcp-server-rs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wm-mcp-server"
3-
version = "1.6.0"
3+
version = "1.6.1"
44
edition = "2024"
55
description = "MCP server for managing webMethods Integration Server via pure HTTP API"
66
license = "MIT"

mcp-server-rs/src/client/webservices.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl super::ISClient {
2727
pub async fn openapi_doc_get(&self, rad_name: &str) -> Result<Value, String> {
2828
self.invoke_post(
2929
"wm.server.openapi:getOpenAPIDoc",
30-
&json!({"radName": rad_name}),
30+
&json!({"radName": rad_name, "openapi.json": "true"}),
3131
)
3232
.await
3333
}

mcp-server-rs/src/server.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,9 @@ impl WmServer {
23582358
}
23592359
}
23602360

2361-
#[tool(description = "Get the OpenAPI document (JSON/YAML) for a REST API descriptor.")]
2361+
#[tool(
2362+
description = "Get the OpenAPI document for a REST API descriptor.\n\nReturns the full OpenAPI 3.0 spec in JSON format."
2363+
)]
23622364
async fn openapi_doc_get(
23632365
&self,
23642366
Parameters(p): Parameters<OpenApiDocParam>,
@@ -2371,7 +2373,7 @@ impl WmServer {
23712373
}
23722374

23732375
#[tool(
2374-
description = "Generate IS provider services from an OpenAPI specification.\n\nRequired settings: packageName, folderName, radName (output descriptor name).\nProvide either sourceUri (URL) or openapiContent (inline spec).\nOptional: isGroupByTag (true/false)."
2376+
description = "Generate IS provider services from an OpenAPI specification.\n\nRequired settings: packageName, folderName (must exist -- use folder_create first), radName (descriptor name).\nRequired: sourceUri and openapiUrl (set both to 'inline' when providing openapiContent).\n\nRECOMMENDED APPROACH: Pass the spec content directly in openapiContent (JSON or YAML string). Set sourceUri and openapiUrl to 'inline'. IS may not be able to fetch remote URLs.\n\nTo use a remote spec: download it yourself first, then pass the content in openapiContent.\n\nOptional: isGroupByTag (default true).\n\nCreates a REST API descriptor + auto-generated service stubs and resource definitions."
23752377
)]
23762378
async fn openapi_generate_provider(
23772379
&self,

mcp-server-rs/test_e2e.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,17 @@ check "ws_consumer_endpoint_list" "$out" "endpoints"
457457
out=$(mcp_call 2 "rest_resource_list" '{}')
458458
check "rest_resource_list" "$out" "restV2Resources"
459459

460-
# OpenAPI generation tested manually (requires network access from IS).
461-
# The list/get tools are verified above.
460+
# Full OpenAPI generation E2E: create folder -> generate from inline spec -> get doc -> cleanup
461+
mcp_call 2 "folder_create" '{"package":"E2ETestPkg","folder_path":"e2etest.restapi"}' > /dev/null 2>&1
462+
OASETTINGS='{"folderName":"e2etest.restapi","packageName":"E2ETestPkg","radName":"e2eApi","sourceUri":"inline","openapiUrl":"inline","openapiContent":"{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"Test\",\"version\":\"1.0\"},\"paths\":{\"/test\":{\"get\":{\"operationId\":\"getTest\",\"responses\":{\"200\":{\"description\":\"OK\"}}}}}}"}'
463+
out=$(mcp_call 2 "openapi_generate_provider" "{\"settings\":$(echo "$OASETTINGS" | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read().strip()))')}")
464+
check "openapi_generate_provider" "$out" "e2eApi\|radName\|folderName"
465+
466+
out=$(mcp_call 2 "openapi_doc_get" '{"rad_name":"e2etest.restapi:e2eApi"}')
467+
check "openapi_doc_get" "$out" "openapi\|3.0\|paths"
468+
469+
# Cleanup
470+
mcp_call 2 "node_delete" '{"name":"e2etest.restapi:e2eApi"}' > /dev/null 2>&1
462471

463472
# ── Security & Keystore ───────────────────────────────────────
464473
echo "--- Security ---"

0 commit comments

Comments
 (0)