Resolve single allOf wrappers for enum query parameters - #8230
Shubham Padkonde (Shubham-Padkonde) wants to merge 11 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
🟡 Changes recommended
Nested array-item wrappers can still lose array shape and require recursive handling plus regression coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Fixes query-parameter enum type resolution for eligible single-member allOf wrappers, including array scenarios.
Changes:
- Resolves wrapped enum schemas during query parameter generation.
- Adds regression coverage for direct, nested, described, and array cases.
- Documents the fix in the changelog.
| File | Summary |
|---|---|
tests/Kiota.Builder.Tests/KiotaBuilderTests.QueryEnum.cs |
Adds query enum regression tests. |
src/Kiota.Builder/KiotaBuilder.cs |
Updates wrapped enum schema resolution. |
CHANGELOG.md |
Documents the behavior change. |
💡 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. |

Fixes #8108.
A query parameter whose enum reference is wrapped in a single-member
allOfcurrently falls back tostring, even though a direct enum reference works. Resolve empty single-memberallOfwrappers before choosing the query parameter type. Apply the same resolution to array items, preserving the enum reference/name and array shape. Schemas with their own meaningful definition, multiple members, or additional union branches are not flattened by this helper.Added five builder cases: direct-reference control, described wrapper, nested wrappers, wrapped enum array items, and a wrapped array. The original implementation failed all four wrapped cases; the direct-reference control passed. All five pass with this change.
Validation on Linux / .NET SDK 10.0.401:
widget_type: Optional[WidgetType]; the direct enum-array parameter remainslist[WidgetStatus].widgetType=Advanced&statuses=Active, using the installed Kiota abstractions. No network request was sent.Developed and tested with AI assistance. Other generated-language runtime tests and live service requests were not run.
Formatting verification passed for both changed C# files.