Repository navigation
fix(api): reject conflicting multipart file shapes - #44903
Merged
crazywoola merged 3 commits intoOct 30, 2026
Merged
Conversation
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44903 +/- ##
===========================================
+ Coverage 68.68% 89.67% +20.98%
===========================================
Files 6083 6149 +66
Lines 367753 390568 +22815
Branches 77976 77656 -320
===========================================
+ Hits 252597 350239 +97642
+ Misses 112353 34028 -78325
- Partials 2803 6301 +3498
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3 of 5 tasks
crazywoola
approved these changes
Oct 30, 2026
crazywoola
approved these changes
Oct 30, 2026
1 task done
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.
Summary
Fixes #44902.
OpenAPI multipart requests that mix
files(orfiles[]) withfiles[doc](orfiles[doc][]) currently return an unhandled HTTP 500 when the direct part comes first. Reversing the same parts already returns the intended HTTP 422invalid_param.Check that the existing target is a mapping before looking up or assigning a keyed part. Incompatible file/list/map shapes now use the existing
InvalidFileParterror consistently in either order. Valid multipart shapes and the public error schema are unchanged.Added eight regression cases covering scalar/list and keyed scalar/list parts in both orders.
The repository’s autofix bot also corrected one stale Pillow
requires-distconstraint inapi/uv.lockto match the existingdify-agent/pyproject.toml. This is lock metadata only; no locked package version changed. The unchanged default-branch lock failsuv 0.13.6 lock --checkas well, which blocked the first CI run before tests executed.Validation
TypeError; the other eleven tests pass.ExternalApierror formatter: four HTTP 500 responses before the fix; all eight combinations return HTTP 422invalid_paramafter the fix. This exercises the HTTP parsing/error boundary; it is not a full deployed workflow run.make lint: passed, including 75 import contracts.make type-check PATH_TO_CHECK=api/controllers/openapi/_multipart.py: passed.test__multipart.py: zero diagnostics.git diff --check: passed.uv 0.13.6 lock --project api --check: passed after the bot’s metadata correction; reproduced the stale-lock failure before that correction.Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint gods. (backend lint and scoped production/test type checks; no frontend changes)AI assistance was used for investigation, implementation, and verification. The results above are local validation; remote CI and maintainer review are separate.
From Codex