Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-16535

'next' key in API response does not respect reverse sorting by updated_on

    XMLWordPrintable

Details

    Description

      When I use the following url:

      #!python
      
      https://api.bitbucket.org/2.0/repositories?role=member&sort=updated_on
      

      and then check the 'next' key in the response, i see an url like this:

      #!python
      
      https://api.bitbucket.org/2.0/repositories?sort=updated_on&after=2016-08-30T12%3A59%3A02.440738%2B00%3A00&role=member
      

      This is fine, it will loop me back to the beginning of times

      However, if i use the url:

      #!python
      
      https://api.bitbucket.org/2.0/repositories?role=member&sort=-updated_on
      

      and then check the next field I would expect the response to contain a search for 'before' to be able to loop to beginning of times. Instead, the next field contains this url:

      #!python
      
      https://api.bitbucket.org/2.0/repositories?sort=-updated_on&after=2017-11-10T13%3A40%3A17.624877%2B00%3A00&role=member
      

      This way i can only request one page, unless i build the next url myself.

      Attachments

        Activity

          People

            Unassigned Unassigned
            f9acb842b534 johanjansen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: