alex_dimov
11/28/2022, 12:37 PMdef get_next(self, response: Response) -> str | None:
"""Get the next page token.
Args:
response: API response object.
returns:
The next page token.
"""
all_matches = extract_jsonpath(self._jsonpath, response.json())
return next(all_matches, None)
Here is my example
[
{
id: 1
dateTime: "11-10-2022T12:03:00"
},
{
id: 2
dateTime: "11-10-2022T12:04:00"
},
{
id: 3
dateTime: "11-10-2022T12:06:00"
},
]
This function returns 1. But it would be logical for me if it returned 3 (so that in the next query I could put where id > 3
Please help me understand this moment.
I understand that I can redefine this function and make it return the last element instead of the first one, but I want to understand why this function was originally described so that it returns the first element?
(Perhaps it is described for the case of sorting in descending order?)