Preserve properties of single inline allOf objects - #8232
Shubham Padkonde (Shubham-Padkonde) wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues remain, and all supplied assessments indicate approval readiness.
Review effort: Lite
Findings: None
What changed in this PR
Fixes loss of properties and referenced models in components containing a single inline allOf object.
Changes:
- Merge single inline
allOfschemas before model creation. - Add regression tests for affected schema shapes.
- Document the fix in the changelog.
| File | Description |
|---|---|
tests/Kiota.Builder.Tests/KiotaBuilderTests.SingleInlineAllOf.cs |
Adds regression tests. |
src/Kiota.Builder/KiotaBuilder.cs |
Preserves inline allOf properties during model creation. |
CHANGELOG.md |
Records the behavior fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
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. |
|
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 #7762.
A component containing one inline
allOfobject is neither classified as inheritance nor as a multi-member intersection. Model creation consequently reads the outer schema's properties, omitting the inline properties and any models reachable only through them.Merge a single inline member that contains properties before creating the model. The merged schema retains the component identity and any sibling properties. A single
$refmember continues to follow the existing inheritance/squashing rules.Tests cover wrappers with and without an explicit outer object type, an equivalent direct-object control, and a wrapper with a sibling property. Both original wrapped cases failed on main while the direct-object control passed; all four final cases pass.
The issue's YAML has its response
schemaindented outsideapplication/json. I corrected only that indentation for the CLI reproduction; the inline-allOf data-loss bug still reproduced.Developed and tested with AI assistance. Validation details follow.
Validation on Linux / .NET SDK 10.0.401:
other.identificationsurvives deserialization and serialization.Formatting verification passed for both changed C# files. All 18 CLI tests passed after rebuilding with one worker; the first parallel CLI test build terminated with MSB4166 before tests ran.