Skip to content

Preserve properties of single inline allOf objects - #8232

Open
Shubham Padkonde (Shubham-Padkonde) wants to merge 10 commits into
microsoft:mainfrom
Shubham-Padkonde:fix/single-inline-allof-properties
Open

Shubham Padkonde (Shubham-Padkonde) wants to merge 10 commits into
microsoft:mainfrom
Shubham-Padkonde:fix/single-inline-allof-properties

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor

Fixes #7762.

A component containing one inline allOf object 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 $ref member 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 schema indented outside application/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:

  • Full builder suite: 2,353 passed, 2 skipped.
  • CLI build succeeded for net8.0, net9.0, and net10.0 (SourceLink warnings from building a Windows-created worktree through WSL).
  • Generated C# from the corrected reproduction, compiled its model classes with Microsoft.Kiota.Bundle 2.1.2, and verified that other.identification survives deserialization and serialization.
  • No live service request was made. Other generated-language runtime tests were not run.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 allOf schemas 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.

@baywet

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings September 21, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 22, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 22, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baywet

Copy link
Copy Markdown
Member

Shubham Padkonde (@Shubham-Padkonde) this PR is conflicting, would you mind handling the conflicts when you have a minute please?

Copilot AI review requested due to automatic review settings September 23, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 23, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 23, 2026 17:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 24, 2026 01:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 25, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 25, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#] Single-element allOf wrapping an inline object silently drops the property and prunes its referenced schema

3 participants