-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various issues with pagination support
Fix several issues with pagination support uncovered by converting Gafaelfawr to the new approach. * Document the type parameterization of cursors. * Document the need to implement `from_entry` for cursors derived from `DatetimeIdCursor`. * Move cursor parsing into the body of the suggested handler function since FastAPI cannot validate complex models as query parameters. * Change the pagination exception to a new `InvalidCursorError` instead of `ValueError` since parsing will be done in the handler body and needs to throw an error that can be automatically handled and converted to a 422 HTTP status code. * Rename `PaginatedLinkData` to `PaginationLinkData` for more correct grammar. * Drop `DeclarativeBase` from the prototype of `query_object` because tuples are not covariant and this does not pass type checking. * Document that `query_object` and `query_row` cannot be fully type-checked.
- Loading branch information
Showing
4 changed files
with
57 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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 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 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 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