Fix nullable array query parameter types - #8238
Shubham Padkonde (Shubham-Padkonde) wants to merge 10 commits into
Conversation
|
Shubham Padkonde (@Shubham-Padkonde) your behaviour is disruptive, opening about 30 PRs on the repos in a couple of hours time, most likely code that was AI generated and not tested/reviewed, will only clog our review pipeline. Please stop opening additional pull requests and work on the comments added to existing ones. We have turned on pull requests limits on this repository, and will proceed to blocking you at the organization level if additional pull requests are opened on other repositories before the already opened ones are reviewed and closed/or merged. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes nullable array query parameter generation for anyOf/oneOf schemas containing a null branch.
Changes:
- Unwraps eligible nullable schema wrappers.
- Preserves array and enum item types.
- Adds regression tests and changelog documentation.
| File | Description |
|---|---|
tests/Kiota.Builder.Tests/KiotaBuilderTests.NullableQueryArray.cs |
Adds nullable query-array regression coverage. |
src/Kiota.Builder/KiotaBuilder.cs |
Corrects query parameter type and collection inference. |
CHANGELOG.md |
Records the fix for issue #7210. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Shubham Padkonde (@Shubham-Padkonde) this PR is conflicting, would you mind handling the conflicts when you have a minute please? |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
1 similar comment
|
Conflicts have been resolved. A maintainer will take a look shortly. |
Fixes #7210.
A query schema expressed as
anyOf: [array, null]currently generates a scalar string, preventing callers from supplying multiple values. Unwrap a union with exactly one null branch before determining the query parameter type, collection shape and enum declaration. This also handlesoneOfand nested nullable wrappers; mixed unions and schemas with their own meaningful constraints retain the existing behavior.Nine regression cases cover both keywords and member orders, nested wrappers, enum arrays, ordinary arrays and scalar/mixed-union controls. The original four nullable array cases all failed before the change.
Developed with Codex assistance.
Validation:
GetsGithubFromApisGuruWithExactMatchAsyncduring an external HTTP download (100-second timeout). The suite is not fully green.string? Idsbefore this fix andstring[]? Idsafterward. The generated C# client compiles with .NET 10 and Microsoft.Kiota.Bundle 2.1.2. A runtime check verifies two IDs produce?ids=first&ids=second, while omitted and explicitly null IDs produce no query string. No HTTP requests were sent.