Repository navigation
Fix form mapping for file lists and dictionary keys containing brackets - #69782
Open
MohamedHasan3644 wants to merge 4 commits into
Open
MohamedHasan3644 wants to merge 4 commits into
MohamedHasan3644 wants to merge 4 commits into
Conversation
MohamedHasan3644
requested review from
a team,
BrennanConroy and
halter73
as code owners
October 13, 2026 04:15
MohamedHasan3644
marked this pull request as draft
October 13, 2026 04:16
Contributor
|
Thanks for your PR, @MohamedHasan3644. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation addresses the reported binding failures with consistent behavior and comprehensive regression coverage.
0 open findings
What changed in this PR
Fixes form mapping for file collections and dictionary keys containing closing brackets.
Changes:
- Corrects prefix-aware file discovery and root file-list binding.
- Preserves embedded
]characters in dictionary keys. - Adds focused unit and endpoint regression coverage.
| File | Description |
|---|---|
RequestDelegateFactoryTests.FormMapping.cs |
Adds endpoint-level regression tests. |
RequestDelegateFactory.cs |
Applies root file-list parameter prefixes. |
BrowserFileFromFormFileTests.cs |
Tests unmatched browser-file lists. |
FormDataMapperTests.cs |
Covers file discovery and bracketed dictionary keys. |
FormDataReader.cs |
Identifies structural closing brackets. |
FileConverter.cs |
Makes file-list discovery prefix-aware. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
MohamedHasan3644
marked this pull request as ready for review
October 14, 2026 12:49
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bug Description
[FromForm] IReadOnlyList<IFormFile>parameters did not respect the parameter name or an explicit[FromForm(Name = "...")]alias.]were truncated, preventing the submitted values from binding correctly.Description of Code Changes
IReadOnlyList<IFormFile>andIReadOnlyList<IBrowserFile>.IFormFileCollectionunder indexed paths so unrelated uploads do not keep collection probing active.IFormFileCollectionproperty.IReadOnlyList<IFormFile>.].Areas Covered
Validation
Endpoint Regression Tests
SupportsFormFileListInCollectionItemSupportsFormFileCollectionInCollectionItemSupportsRootFormFileListfilesand the explicit aliasdocs.SupportsDictionaryKeyContainingClosingBracketa=1, x]y=2.Both rows were verified independently:
Form-Mapping Unit Tests
Deserialize_Dictionary_KeyContainingClosingBracketx]y,x], andx]]y.Deserialize_Dictionary_KeyContainingClosingBracket_WithNestedDictionaryDeserialize_Dictionary_KeyContainingClosingBracket_WithComplexValueDeserialize_Dictionary_KeyContainingClosingBracket_WithCollectionValueCanDeserialize_ComplexType_IReadOnlyListFormFileWithNoMatches_IsNotFoundTryRead_IBrowserFileList_WithNoMatchingFiles_IsNotFoundfound = false.Existing parser expectations were updated for embedded brackets while retaining coverage for structural boundaries and malformed inputs.
Build and Test Results
Recorded local validation:
Output
Before
After
Fixes #69717