.Net: Python: Bug: OpenAPI plugin sends array and boolean query parameters as Python repr (tags=['a', 'b'], active=True)
I maintainer di solito rispondono entro 3 giorni
@jeevan1098 ci sta già lavorando.
Dal 12/11/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py, especially the query, header, and path parameter handling cited in the issue, and check how the .NET OpenAPI plugin serializes arrays. Use the offline httpx.MockTransport reproduction to inspect the captured URL. Done means array query values use repeated keys and booleans are lowercase; account for the linked open pull request before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The OpenAPI plugin builds the query string with urlencode(segments) and passes argument values through unchanged:
Without doseq=True, urlencode calls str() on each value. So an array query parameter is sent as Python's list repr (['red', 'blue']), and a boolean is sent as True/False. APIs can't parse either. OpenAPI's default for query parameters is style: form, explode: true, which means tags=red&tags=blue and active=true. The .NET OpenAPI plugin already serializes arrays this way.
The schema advertised to the model says {"type": "array", "items": {"type": "string"}}, so a tool call from the model hits this.
Header and path parameters have the same problem, since they use str(argument) (L218, L331).
To Reproduce
semantic-kernel 1.47.0. rest_api_operation.py is the same on main (25bd1bb6). This runs offline: httpx.MockTransport captures the request, and the server is an IP literal so the URL validator doesn't need DNS.
import asyncio, httpx
from semantic_kernel import Kernel
from semantic_kernel.connectors.openapi_plugin import OpenAPIFunctionExecutionParameters
spec = {
"openapi": "3.0.1", "info": {"title": "t", "version": "1"},
"servers": [{"url": "https://93.184.216.34"}],
"paths": {"/items": {"get": {
"operationId": "listItems",
"parameters": [
{"name": "tags", "in": "query", "schema": {"type": "array", "items": {"type": "string"}}},
{"name": "active", "in": "query", "schema": {"type": "boolean"}},
],
"responses": {"200": {"description": "ok"}},
}}},
}
seen = []
def handler(request):
seen.append(str(request.url))
return httpx.Response(200, json={})
async def main():
client = httpx.AsyncClient(transport=httpx.MockTransport(handler))
kernel = Kernel()
plugin = kernel.add_plugin_from_openapi(
"api", openapi_parsed_spec=spec,
execution_settings=OpenAPIFunctionExecutionParameters(http_client=client),
)
await kernel.invoke(plugin["listItems"], tags=["red", "blue"], active=True)
print(seen[0])
asyncio.run(main())
Output:
https://93.184.216.34/items?tags=%5B%27red%27%2C+%27blue%27%5D&active=True
Expected behavior
https://93.184.216.34/items?tags=red&tags=blue&active=true
(form/explode, the OpenAPI default for query parameters), with booleans written as JSON true/false.
Platform
- Language: Python
- Source: semantic-kernel 1.47.0 (pip) /
mainat 25bd1bb6 - AI model: n/a (no model call needed)
- IDE: n/a
- OS: Windows 11, Python 3.12
Additional context
The parser doesn't read style/explode from the spec yet (RestApiParameter is always built without them), so the smallest fix is to serialize lists as repeated keys (doseq=True) and booleans as lowercase. Happy to send a fix if that helps.
- Lingua principale
- C#
- Stelle
- 28.8k
- Fork
- 4.9k
- Merge medio
- 2g 17h
- PR unite (30g)
- 48
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 microsoft/semantic-kernel
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentForse già presa @halcyon-past l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/semantic-kernel#14824 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Python: Bug: Redis search returns None for every field that declares a storage_name, because RETURN lists the declared nameForse già presa @wasim-builds l’ha presa 9 giorni fa. Apertapython triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/semantic-kernel#14753 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Forse già presa @nightcityblade l’ha presa 46 giorni fa. Aperta.NET triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
microsoft/semantic-kernel#14526 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Forse già presa @VANDRANKI l’ha presa 48 giorni fa. Apertapython triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/semantic-kernel#14522 ·
I maintainer di solito rispondono entro 3 giorni
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URIForse già presa @Laurianti l’ha presa 48 giorni fa. Aperta.NET triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/semantic-kernel#14518 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di microsoft/semantic-kernel
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Support Flux ignore rules (drift detection ignore paths) in Microsoft.KubernetesConfiguration schemaAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Azure/azure-resource-manager-schemas#3921 ·
I maintainer di solito rispondono entro 1 giorno
-
text-align: justify is ignored in HTML to PDF conversionForse già presa @PrzemyslawKlys l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
asyncapi/modelina#2709 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno