diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index 186e61d9b..8c434ea4f 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -898,10 +898,16 @@ class CursorPagination(BasePagination): 'next': { 'type': 'string', 'nullable': True, + 'format': 'uri', + 'example': 'http://api.example.org/accounts/?{cursor_query_param}=cD00ODY%3D"'.format( + cursor_query_param=self.cursor_query_param) }, 'previous': { 'type': 'string', 'nullable': True, + 'format': 'uri', + 'example': 'http://api.example.org/accounts/?{cursor_query_param}=cj0xJnA9NDg3'.format( + cursor_query_param=self.cursor_query_param) }, 'results': schema, }, diff --git a/tests/test_pagination.py b/tests/test_pagination.py index c028f0ea8..5d7864700 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -922,10 +922,14 @@ class CursorPaginationTestsMixin: 'next': { 'type': 'string', 'nullable': True, + 'format': 'uri', + 'example': 'http://api.example.org/accounts/?cursor=cD00ODY%3D"' }, 'previous': { 'type': 'string', 'nullable': True, + 'format': 'uri', + 'example': 'http://api.example.org/accounts/?cursor=cj0xJnA9NDg3' }, 'results': unpaginated_schema, },