Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

paging: if nextLink is an empty string, paging will get into a dead loop #147

Closed yugangw-msft closed 5 years ago

yugangw-msft commented 5 years ago

//CC: @lmazuel, @iscai-msft

2 lines patch will get it go away, but I am not so sure that is a right fix.

        if self.next_link is None:
            raise StopIteration("End of paging")
        self._current_page_iter_index = 0
        self._response = self._get_next(self.next_link)
        self._derserializer(self, self._response)
        # start patch 
        if self.next_link == '':
             self.next_link = None
        # end patch
        return self.current_page
yugangw-msft commented 5 years ago

It is a service end issue to be fixed by Advisor team. Even Java and .net team support nextLink with an empty string, but for Python there are no good reasons to do it right now