-
Notifications
You must be signed in to change notification settings - Fork 444
feat(event_handler): add File parameter support for multipart/form-data uploads in OpenAPI utility #7132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oyiz-michael
wants to merge
17
commits into
aws-powertools:develop
Choose a base branch
from
oyiz-michael:feature/file-parameter-clean
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(event_handler): add File parameter support for multipart/form-data uploads in OpenAPI utility #7132
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a09f1fa
feat(event-handler): add clean File parameter support for multipart u…
oyiz-michael cbe7118
make format
oyiz-michael c299573
feat: Add File parameter support for multipart/form-data file uploads
oyiz-michael f074f30
make format
oyiz-michael c5e6674
refactor: reduce cognitive complexity in multipart parsing
oyiz-michael 475c7f4
make format
oyiz-michael 0744776
fix: resolve linting issues in File parameter implementation
oyiz-michael 3a5cdb1
fix: ensure Python version compatibility for union types
oyiz-michael 082e492
Merge branch 'develop' into feature/file-parameter-clean
oyiz-michael 853b087
test cases updated
oyiz-michael 45f71d5
make format
oyiz-michael d138c94
fix linit issue with unused import
oyiz-michael 54b3723
Merge branch 'develop' into feature/file-parameter-clean
oyiz-michael f78af9a
additional test
oyiz-michael bd19bee
feat(event-handler): Add UploadFile class for file metadata access
oyiz-michael c3ef7bd
refactor(event-handler): reduce cognitive complexity in _request_body…
oyiz-michael 900fc9a
Merge branch 'develop' into feature/file-parameter-clean
oyiz-michael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I guess this method returns the decode content of the file and while this is nice, I think developers must also have access to filename, headers, content-type to reconstruct the file in the Lambda..
I'm talking about something like FastAPI is doing with UploadFile class - https://fastapi.tiangolo.com/reference/uploadfile/#fastapi.UploadFile.file.
Can you investigate this, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look in to it and see how we can have that part of the implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leandrodamascena! Great feedback! I've implemented exactly what you requested - a FastAPI-inspired UploadFile class that provides developers with complete access to filename, headers, content-type, and all metadata needed to reconstruct files in Lambda functions.
UploadFile Response:
{
"filename": "important-document.pdf",
"content_type": "application/pdf",
"size": 52,
"headers": {
"Content-Type": "application/pdf",
"X-Upload-ID": "12345",
"X-File-Hash": "abc123def456"
},
"content_preview": "PDF file content with metadata for reconstruction.",
"can_reconstruct_file": true
}
Backward Compatibility Response:
{
"message": "Existing code works!",
"size": 27
}