Solved

Bug: Inappropriate pagination deprecation header for /admin/api/2019-04/products.json?page=2

Isaac_Bowen
Shopify Partner
77 0 25

I'm receiving a deprecation header on ?page=2 requests to the 2019-04 REST admin API, for metafields, products, events, collects, and customer saved searches.

 

An illustrative request:

curl -I -H "x-shopify-access-token: xxx" https://example.myshopify.com/admin/api/2019-04/products.json\?limit\=1\&page\=2

The deprecation header looks like so:

x-shopify-api-deprecated-reason: https://help.shopify.com/api/guides/paginated-rest-results

Requests for the first page of resources (i.e. omitting the page param) do not receive a "link" header, giving me nothing to do with the deprecation notice, while cluttering the bit of our monitoring that watches for deprecations.

 

I'm titling this post as a bug report because, from what I understand, (a) cursor-based pagination isn't even partially available until 2019-07, (b) 2019-07 doesn't return the deprecation header for ?page=2 (though the "link" header is present, as documented, for the first page), and (c) the shopify_api gem doesn't yet have support for cursor-based pagination at all (and when it lands, it looks like it's only going to initially be available for unstable).

I made Locksmith and Mechanic. 🙂
Accepted Solution (1)

Ryan
Shopify Staff
499 42 120

This is an accepted solution.

Hi Isaac,

 

Chatted about this internally a bit and it is intended.  Since the ability to use the page parameter is removed in 2019-07 (release notes) the header is being displayed on any calls that would actually fail if they were made to 2019-07 instead of 2019-04.  We wouldn't be able to return the header on those calls in a newer version because we don't allow them.  It is a warning to the apps making the calls that in the future they would be removed.

 

2019-07 doesn't return the deprecation header for ?page=2

This is likely because you are calling an endpoint that does not yet have page removed in the 2019-10 version, but let me know if that isnt the case.

 

the shopify_api gem doesn't yet have support for cursor-based pagination at all (and when it lands, it looks like it's only going to initially be available for unstable).

Will pass this along to the team so we can be sure it supports all versions.

 

Hope that helps.

 

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 2 (2)

Ryan
Shopify Staff
499 42 120

This is an accepted solution.

Hi Isaac,

 

Chatted about this internally a bit and it is intended.  Since the ability to use the page parameter is removed in 2019-07 (release notes) the header is being displayed on any calls that would actually fail if they were made to 2019-07 instead of 2019-04.  We wouldn't be able to return the header on those calls in a newer version because we don't allow them.  It is a warning to the apps making the calls that in the future they would be removed.

 

2019-07 doesn't return the deprecation header for ?page=2

This is likely because you are calling an endpoint that does not yet have page removed in the 2019-10 version, but let me know if that isnt the case.

 

the shopify_api gem doesn't yet have support for cursor-based pagination at all (and when it lands, it looks like it's only going to initially be available for unstable).

Will pass this along to the team so we can be sure it supports all versions.

 

Hope that helps.

 

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Isaac_Bowen
Shopify Partner
77 0 25

Sounds good, thanks for following up. 🙂

I made Locksmith and Mechanic. 🙂