Metriche repository
- Star
- (3783 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Due to the dynamic nature of JSON:API, which I'm trying to generate a C# client for, we need the query string parameters to be unconstrained. Is there a way to do that with Kiota?
The C# Web API produces the following OAS, which results in an IDictionary<string, string?> query method parameter using NSwag:
"parameters": [
{
"name": "query",
"in": "query",
"description": "...",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string",
"nullable": true
},
"example": null
}
}
]
When passing the following value to the NSwag-generated method:
new Dictionary<string, string?>
{
["filter"] = "has(assignedTodoItems)",
["sort"] = "-lastName",
["page[size]"] = "5"
}
it gets translated to:
?filter=has(assignedTodoItems)&sort=-lastName&page[size]=5
Kiota generates the following instead:
[QueryParameter("query")]
public string? Query { get; set; }
It's unclear to me how to pass a query string to the generated code that produces:
?filter[node.parent.parent.parent...]=equals(name,'X') because it always emits ?query=....
The produced OAS is not set in stone, though it would be preferable if it works with both NSwag and Kiota.