.Net: Python: Bug: OpenAPI plugin sends array and boolean query parameters as Python repr (tags=['a', 'b'], active=True)
Maintainers usually reply within 3 days
@jeevan1098 is already working on this.
Since Nov 12, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 28.8k
- Forks
- 4.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 48
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/semantic-kernel
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
Python: Bug: Redis search returns None for every field that declares a storage_name, because RETURN lists the declared namePossibly taken @wasim-builds claimed this 9 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/semantic-kernel#14753 · 1 comment ·
Maintainers usually reply within 3 days
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Possibly taken @nightcityblade claimed this 46 days ago. Open.NET triage
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/semantic-kernel#14526 · 1 comment ·
Maintainers usually reply within 3 days
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Possibly taken @VANDRANKI claimed this 48 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/semantic-kernel#14522 ·
Maintainers usually reply within 3 days
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URIPossibly taken @Laurianti claimed this 48 days ago. Open.NET triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/semantic-kernel#14518 ·
Maintainers usually reply within 3 days
All issues in microsoft/semantic-kernel
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Support Flux ignore rules (drift detection ignore paths) in Microsoft.KubernetesConfiguration schemaOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Azure/azure-resource-manager-schemas#3921 ·
Maintainers usually reply within 1 day
-
text-align: justify is ignored in HTML to PDF conversionPossibly taken @PrzemyslawKlys claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
asyncapi/modelina#2709 · 1 comment ·
Maintainers usually reply within 1 day