-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex filter query gets escaped #5641
Comments
Hi @Aculeo This is caused by the fact that clients use URI templates - RFC 6570 to project URLs and their parameter values. And the RFC dictates the encoding of such characters The template (found in the request builder class), probably looks something like this: The filter value gets encoded while the template is expanded. Although it's not a hard requirement from RFC9110, servers usually decode percent encoded characters in query parameters values. Maybe this is hidden behind a configuration option? (if you run the service/server) Another option is to decode the query parameters values in a middleware handler before the request is sent on the network. Let us know if you have any additional comments or questions. |
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Nuget tool
Client library/SDK language
Csharp
Describe the bug
I am attempting send a request that has the following query parameter:
<url>?filter=[_and][0][location][_eq]=123
This is the normal filter syntax for Directus, headless CMS / backend system. Docs: https://docs.directus.io/reference/query.html#filter
Most of the parameters are simple enough to set:
But the filter parameter gets escaped when I check the actual URL getting called:
Not sure if it's a bug or I am doing this wrong, but I would appreciate any help to get this working.
Expected behavior
Complex filter query should not be escaped:
<url>?filter=[_and][0][location][_eq]=123
How to reproduce
Somewhat difficult to provide, the OpenAPI spec is dynamically generated based upon the setup of the Directus instance. I can attempt to provide a smaller sample if necessary.
I set up Kiota like this (token was just taken from browser):
Open API description file
No response
Kiota Version
1.19.1
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
No response
Configuration
No response
Debug output
No response
Other information
No response
The text was updated successfully, but these errors were encountered: