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
Migrate library folder contents
API to FastAPI
#14223
Migrate library folder contents
API to FastAPI
#14223
Conversation
Let's use |
Sure! Do we want to replace all |
I think changing all occurrences is going to be a big project (see my stale PR #13598), but when converting or adding new routes I think we should always prefer |
Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
FolderIdPathParam: DecodedDatabaseIdField = Path( | ||
..., title="Folder ID", description="The encoded identifier of the library folder." |
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 don't know/understand much of the pydantic stuff, but I'd expect to find EncodedDatabaseIdField at the API layer like here, and DecodedDatabaseIdField in services/managers/controllers. Here it looks confusing when you compare the type and description.
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 got a bit confused too at the beginning, that's why I kept using EncodedDatabaseIdField
, but using DecodedDatabaseIdField
is waaaay cleaner as Marius suggested, we can avoid any further explicit decoding down the road.
I guess we can just rename it to DatabaseIdField
or something similar to reduce the confusion after we get rid of the existing EncodedDatabaseIdField
s.
I'm trying to refactor and simplify the
folder_contents
API as part of a different PR and then see if I can optimize theindex
endpoint when trying to search on folders containing a large number of elements.I've extracted these changes that focus only on migrating the current code to FastAPI for easier review.
How to test the changes?
License