Preserve multipart models with partial encoding maps - #8240
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 comments remain, and regression coverage is included.
Review effort: Lite
Findings: None
What changed in this PR
Fixes multipart model discovery when encoding maps omit properties or contentType, while preserving unsupported explicit encodings.
Changes:
- Applies multipart default content types when needed.
- Adds five regression cases.
- Documents the fix in the changelog.
| File | Description |
|---|---|
tests/Kiota.Builder.Tests/KiotaBuilderTests.MultipartEncoding.cs |
Adds regression coverage. |
src/Kiota.Builder/KiotaBuilder.cs |
Updates multipart property model selection. |
CHANGELOG.md |
Records the 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. |
1 similar comment
|
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 #7342.
When a multipart media type includes an encoding map, model creation currently visits only properties with an explicit supported
contentType. An object property omitted from that map therefore loses its model, even though its default content type is JSON. The same happens when its encoding has nocontentType.Visit the schema properties and use an explicit content type when supplied, otherwise the existing multipart default rules. Explicit unsupported encodings retain the existing behavior. This follows the per-property defaults in the OpenAPI Encoding Object.
Five regression cases cover an empty map, an encoding for another property, an encoding without a content type, explicit JSON and an unsupported explicit content type. Two cases fail before the change; all five pass afterward.
Developed with Codex assistance.
Validation:
KiotaBuilderTestspass, including the new cases and existing multipart/content-type priority cases.CreateUserInfoRequestbefore the fix. Afterward, the generated C# client compiles with .NET 10 and Microsoft.Kiota.Bundle 2.1.2. A runtime check builds a multipart request and verifies that it contains the JSON first/last names and the HTML template. No HTTP requests were sent.This addresses partial multipart encoding maps; it does not change selection between multiple request-body media types discussed in the linked issue #6451.