-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add post endpoint for attachments #11 #12
Conversation
3008389
to
4535f0c
Compare
4535f0c
to
3e4c409
Compare
c04870b
to
a6bf857
Compare
@VKTB The core functionality is done, I will look at the tests next. Feel free to have a look - especially at the error handling. |
f6be5f5
to
7d7433b
Compare
7d7433b
to
98f3e41
Compare
e78fd7e
to
e31b832
Compare
8738ad3
to
b0d0c0c
Compare
b0d0c0c
to
9b389c3
Compare
31ac96b
to
544107d
Compare
544107d
to
e715eb7
Compare
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.
Some initial comments from me. Not sure if you want to keep the TODOs in or remove them, I will leave it to you to decide.
AttachmentServiceDep = Annotated[AttachmentService, Depends(AttachmentService)] | ||
|
||
|
||
@router.post( |
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 think we should ask ourselves here if it is clear enough that this endpoint (given its prefix and path) is used for getting a pre-signed URL rather than posting an actual attachment. It might help if we look from a perspective of how this router would look like if we also had another endpoint that allows for posting of actual attachments - i.e. how the endpoints would differ.
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.
Yeah good point. I would think
/attachments
for upload of metadata and data/attachments/metadata
for submitting just the metadata about the attachment
We can also argue the same issue for GETs, we will not be downloading an attachment, only its metadata. There I would end up with
/attachments/metadata
for listing all attachment metadata/attachments/metadata/<id>
for getting the information about an individual one (potentially with a presigned url?)
But I am not sure on that second point, nothing about it screams 'will return a presigned download url'. Equally I don't like /attachments/<id>/download
as again its not downloading its just getting a presigned url. This would allow for an upload one if the initial upload failed some how (not something I think we need to worry about now though).
We could also have /download-url
or something, but the upload doesn't make sense there. So I'm not sure there are any nice all round solutions unless you have any suggestions?
Right now I am essentially considering the attachment to be created when the metadata of it is posted, and I would expect it to be created when posting to /attachments
.
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.
unless you have any suggestions?
I am not sure I do at this point, especially given your thoughts on this. I might do further down the line, I will let you know. Probably merge it as it is for now.
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.
Sure, I will make an issue to look at it again a bit later, the endpoints should be easy to change.
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.
27374cd
to
2064e4d
Compare
2064e4d
to
88ce418
Compare
Description
Adds an endpoint
/attachments
for creating new attachments.Notes
core/custom_object_id.py
core/exceptions.py
models/custom_object_id_data_types.py
test/unit/core/test_custom_object.py
models/mixins.py
schemas/mixins.py
Testing instructions
Add a set up instructions describing how the reviewer should test the code
Agile board tracking
Closes #11