Repository navigation
fix(api): reject ambiguous file inputs without extractor changes (#9435) - #9490
Merged
Merged
Conversation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…order (#9435) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Contributor
Code Metrics ReportNote: Metrics describe the revision analyzed by the successful PHPUnit run. Newer commits with pending, canceled or failed checks may not yet be represented in this report.
Details | | main (9a387bd) | #9490 (e1477fc) | +/- |
|---------------------|----------------|-----------------|-------|
+ | Coverage | 76.4% | 76.6% | +0.1% |
| Files | 512 | 512 | 0 |
| Lines | 28856 | 28862 | +6 |
+ | Covered | 22072 | 22115 | +43 |
- | Test Execution Time | 2m58s | 3m42s | +44s |Code coverage of files in pull request scope (26.9% → 38.9%, patch 100.0%)
Reported by octocov |
vitormattos
marked this pull request as ready for review
November 14, 2026 18:03
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
This was referenced Nov 14, 2026
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.
Problem
FileController::save()currently gives implicit precedence to the multipartfileskey overfile, and to multipart uploads over JSON file references. The JSONfilesarray similarly overridesfile. If clients inadvertently provide multiple nonempty input representations, the API may return success while silently ignoring some supplied documents.The endpoint's source documentation also omits the canonical single-file multipart field
fileused by the LibreSign frontend.Changes
IRequest::getUploadedFile('file')andgetUploadedFile('files')calls insidesave(); this retains compatibility with the proposed detection in feat: Document uploaded files as multipart request bodies nextcloud/openapi-extractor#401.file/filesreferences and multipartfile/files[]fields with the existing 422 response before persisting any file. A single selected input form is unchanged, including legacyfile[]arrays.Non-goals / coordination
composer openapiCI output. This protects current backend behavior but cannot generate missing multipart OpenAPIrequestBodyschemas; Document multipart uploads in the OpenAPI contract #9435 remains open.EffectivePolicyValuesolely to accommodate unsupportedanyOfintypescript-axios.Validation
mainat9a387bdbb844721d3607f6fa2b26522b6571785f.PHPUnitstep passed in the PostgreSQL/PHP 8.5 workflow at1e037b729c847ce4c20402a1951e21ffda4e6459.Required CI / acceptance
composer test:unit -- --filter FileControllerInputSourceTestcomposer openapiand the OpenAPI PHPUnit suite to ensure regenerated contracts match the new PHPDoc.fileandfiles[]must return 422 without creating files; each accepted form must retain the existing response.Refs: #9435, #9437, nextcloud/openapi-extractor#401.
Do not auto-close #9435; upstream schema generation remains unresolved.