Skip to content

fix: broken upload of attachment via api#8156

Open
Somebodyisnobody wants to merge 1 commit into
nextcloud:mainfrom
Somebodyisnobody:fix-attachment-api-upload
Open

fix: broken upload of attachment via api#8156
Somebodyisnobody wants to merge 1 commit into
nextcloud:mainfrom
Somebodyisnobody:fix-attachment-api-upload

Conversation

@Somebodyisnobody

Copy link
Copy Markdown
Contributor

Summary

Fixes an issue that prevents a user from uploading any attachment to a card by using the api endpoint POST /boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments which in practice broke the endpoint completely. The issue was raised in 5cf4861 as $data of AttachmentApiController::create() is not required but was marked as required.

TODO

--

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

Do you really want a unit test for checking if a parameter is optional?

A general remark: This repository should have API tests, that covers basic cases of the api documented under https://deck.readthedocs.io/en/stable/API. This broken api controller could have been avoided with a simple, static multipart/form-data request to create an attachment.
I am not able to write such tests in PHP otherwise I would have done it. But maybe someone ready this and has some time :)

fixes an issue raised in 5cf4861 as `$data` is not required but was marked as required.

Signed-off-by: Somebodyisnobody <35230554+Somebodyisnobody@users.noreply.github.com>
@Somebodyisnobody

Copy link
Copy Markdown
Contributor Author

Backlink #7258

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.

Uploading attachment via AttachmentApiController is broken

1 participant