atlassian / go-sentry-api

A go client for the sentry api https://sentry.io/api/
Other
53 stars 39 forks source link

Pagination code no longer seems to work. #41

Open ArcticSnowman opened 1 year ago

ArcticSnowman commented 1 year ago

The pagination code assumes a relative URL for the Next/Previous links

// GetPage will fetch a page via the Link object and decode it from out.
// Should be used like `client.GetPage(link.Previous, make([]Organization, 0))`
func (c *Client) GetPage(p Page, out interface{}) (*Link, error) {
    return c.rawWithPagination("GET", strings.TrimPrefix(p.URL, c.Endpoint), out, nil)
}

It prepends the Endpoint URL to the link URL. This worked until recently as Sentry .io API now returns full URLs for the link.

cwood commented 2 months ago

I assume this is still borked. Sorry been a bad maintainer and haven't looked at this.