You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@miohtama asked me if I have any examples of how to do pagination with pyramid_openapi3.
I don't, but I have some private code that I could potentially share. Ideally, this would be added to README, or be made in to a tutorial. But until this time, let's at least have some information about pagination in this ticket here.
So, firstly, we have this in kafkai.com's openapi.yaml:
- name: pagein: querydescription: Page number (default is 1)required: falseschema:
type: integerdefault: 1minimum: 1
- name: pageSizein: querydescription: Limit number of articles returned (default is 20)required: falseschema:
type: integerdefault: 20minimum: 1maximum: 100
Then we have the following in the view that handles the /articles endpoint:
@miohtama asked me if I have any examples of how to do pagination with pyramid_openapi3.
I don't, but I have some private code that I could potentially share. Ideally, this would be added to README, or be made in to a tutorial. But until this time, let's at least have some information about pagination in this ticket here.
So, firstly, we have this in kafkai.com's openapi.yaml:
Then we have the following in the view that handles the
/articles
endpoint:The
current_used_by()
gets an article from Postgres with SQLAlchemy with the currently logged-in user as context:And this is it. Hopefully it helps someone. And hopefully someone (me?) finds time in the near future to create an example-app for pagination.
The text was updated successfully, but these errors were encountered: