I'm writing a Scala library to make querying an paginated JSON API easier. Each API call returns an object that looks something like this:
{
"count": 100,
"current_page": 1,
"total_pages": 2,
"records": [
...
]
}
I'd like to have a function that returned some sort of iterator like MyIterator[Record]. Are there any standard ways to do this in the Scala world, perhaps even constructs in the standard library that could help me?
I'm using lift-json generally for my JSON parsing, if that's helpful.
Thanks.