bug: openapi-to-mcp appends a second ? to a query-suffixed path template
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- lua, openapi
- Ambito
- api, backend-api-design
Direzione di ricerca
Read apisix/plugins/openapi-to-mcp/tools/handler.lua, focusing on build_path() and _M.call(), where the issue identifies the query suffix and serialized parameters being joined. Check the existing tests added in PR #14154 for query-suffixed templates. Done means the example request uses /b?acl&prefix=logs and the declared parameter reaches the upstream under its own name.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current Behavior
openapi-to-mcp sends a second literal ? upstream when a path template carries a query
suffix and the operation also declares query parameters.
build_path() returns the template with its substitutions, query suffix included, and
_M.call() then appends the serialized query parameters with its own ?:
local url = base_url .. path
if query then
url = url .. "?" .. query
end
For a template of /{Bucket}?acl with a declared prefix query parameter, a call with
Bucket=b and prefix=logs is sent as:
/b?acl?prefix=logs
The upstream parses everything after the first ? as the query string, so it sees one
parameter spelled acl?prefix, and the declared prefix parameter never arrives under
its own name. Query-suffixed path templates are used by S3-style documents.
Verified at runtime against the official test harness on master; the output is identical
on #14154, so the behavior is pre-existing and that PR neither introduces nor changes it.
It surfaced while reviewing #14154, which added the first test coverage for query-suffixed
templates: https://github.com/apache/apisix/pull/14154#discussion_r4475591464
Expected Behavior
The template's query suffix and the serialized query parameters should be merged into one
query string joined by &, so the example above is sent as /b?acl&prefix=logs and every
declared parameter reaches the upstream under its own name.
Steps to Reproduce
- Serve an OpenAPI document whose path is
/{Bucket}?acl, withBucketas a required
path parameter andprefixas a query parameter. - Configure an
openapi-to-mcpRoute using that document. - Call the generated tool with
Bucket=bandprefix=logs. - Observe the upstream request path
/b?acl?prefix=logsrather than/b?acl&prefix=logs.
Environment
- APISIX: current
master, reproduced at6205e4a56 - Component:
apisix/plugins/openapi-to-mcp/tools/handler.lua,build_path()and_M.call()
- Lingua principale
- Lua
- Stelle
- 17.3k
- Fork
- 3k
- Merge medio
- 3g 12h
- PR unite (30g)
- 58
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/apisix
-
ai-proxy forwards client `Transfer-Encoding: chunked` but sends an unchunked body (upstream 400)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
As a user, I want the opa plugin to propagate trace context (traceparent) to OPA, so that OPA spans are linked to the APISIX request traceForse già presa @GitNimay l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/apisix#14051 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
bug: splunk-hec-logging crashes with nil concatenation when error response json lacks text fieldForse già presa @LiteSun l’ha presa 7 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/apisix#14011 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
bug: tcp-logger attempts to send nil data and crashes when json encoding failsForse già presa @LiteSun l’ha presa 7 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/apisix#14003 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
bug: datadog plugin drops service_name tag when service has no name configuredForse già presa @bhuvan-somisetty l’ha presa 35 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/apisix
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nvim-tree/nvim-tree.lua#3383 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Balatro-Multiplayer/BalatroMultiplayerPvP#620 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
Balatro-Multiplayer/BalatroMultiplayerAPI#55 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
silverbulletmd/silverbullet#2231 ·
I maintainer di solito rispondono entro 2 giorni