Repository navigation
fix(openapi-to-mcp): merge query parameters with path suffix - #14166
Open
lordcheng10 wants to merge 2 commits into
Open
lordcheng10 wants to merge 2 commits into
lordcheng10 wants to merge 2 commits into
Conversation
Contributor
Author
|
PTAL @Baoyuantop @nic-6443 @AlinsRan @ruanweihong-aaa @shreemaan-abhishek. This is a minimal follow-up to the query-suffix behavior covered in #14154, with a real-container before/after reproduction for #14161. |
…query-suffix # Conflicts: # t/plugin/openapi-to-mcp.t
moonming
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
openapi-to-mcpcurrently appends serialized query parameters with an unconditional?. Some OpenAPI documents, including S3-style APIs, use a query suffix in the pathtemplate. For
/{Bucket}?aclwithBucket=band a declaredprefix=logsqueryparameter, the tool sends:
The upstream therefore receives one query parameter named
acl?prefix;prefixis not present under its declared name.
The handler now checks whether the constructed URL already contains a query marker
and uses
&in that case. Templates without a query suffix still use?, so theirbehavior is unchanged:
Which issue(s) this PR fixes:
Fixes #14161
Reproduction and evidence
Verified on APISIX 3.19.0 from master
7577c31733bf0f7067cda6af3153b2a56ec8c6f5. The running container'sapisix/plugins/openapi-to-mcp/tools/handler.luahad SHA-2562f293159ca3469ec4f997eadd8ce9f668bc6a2b041296d68d50099209230054c, matching theunmodified master file.
An
openapi-to-mcpRoute served an operation for/{Bucket}?acl. A JSON-RPCtools/callwithBucket=bandprefix=logsreached the Node upstream as:Before:
After applying the patch:
Tests
query-suffix merge.
git diff --checkpasses.wget,luacheck,Test::Nginx,or
t::APISIX; thereforemake lintand the target.tcould not run locally.The real-container reproduction above exercises the complete MCP tool-call path.
Checklist
No documentation update is required because this restores the documented OpenAPI
query-parameter behavior without adding configuration.