Skip to content

Conversation

@NeverBehave
Copy link

@NeverBehave NeverBehave commented Nov 27, 2025

Fixes: #520

This PR adds automatic file upload support for endpoints that accept files (e.g., image attachments, device type images).

Changes:

  • Auto-detect file-like objects in create()/save() data and switch from JSON to multipart/form-data encoding
  • Support for single and multiple file uploads in one request
  • Added helper functions _is_file_like() and _extract_files() in query.py

@jnovinger jnovinger requested review from a team and removed request for a team December 1, 2025 01:40
@jeremystretch jeremystretch requested review from a team and jeremystretch and removed request for a team, arthanson, bctiemann, jeremystretch and jnovinger December 1, 2025 13:39
@jeremystretch
Copy link
Member

@NeverBehave please don't request reviews from individuals unless someone has previously volunteered. We utilize a rotation for assignment of reviewers.

@jeremystretch jeremystretch requested review from arthanson and removed request for jeremystretch December 1, 2025 16:14
@NeverBehave
Copy link
Author

NeverBehave commented Dec 1, 2025

@jeremystretch The request is sent automatically(and won't be able to deselect) by Github since this repo has defined CODEOWNERS, which was added 7 month ago by @arthanson

Reference: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#about-code-owners

@jeremystretch
Copy link
Member

My mistake, thanks for pointing that out. Not sure why that was added as it's not needed. I've opened #717 to remove it.

Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NeverBehave this looks very good, just a couple questions below.

@NeverBehave
Copy link
Author

NeverBehave commented Dec 2, 2025

@arthanson thanks for the review. Both cases updated with corresponded tests covered.

Let me know if there is any other concerns.

@arthanson
Copy link
Collaborator

@NeverBehave some of the tests are failing, can you please check

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.

Extras Image Attachment fails due to incorrect content type

3 participants