ChannelApe / shopify-sdk

Java SDK for Shopify REST APIs
Apache License 2.0
159 stars 110 forks source link

Force API Version to be provided when building Shopify SDK #57

Open rjdavis3 opened 3 years ago

rjdavis3 commented 3 years ago

Shopify SDK currently does not send a Shopify Version to the Shopify REST API when one is not specified during build of ShpoifySDK. You can pass in a Shopify API version using the withApiVersion parameter as of Release 2.3.0.

We have learned from Shopify that they strongly recommend setting a version for each Shopify REST API request or else we unexpected behavior may occur. We should force API Version selection when building the Shopify-SDK. This would be a breaking change.

https://shopify.dev/concepts/about-apis/versioning

It's recommended that you specify what version of the API you want your app to make calls to as our system defaulting to the correct version shouldn't be relied upon. It's best practice to point your app exactly where you want it to go, so it behaves as expected for the specified time frame. Anything outside of that is not guaranteed to work! Additionally, there's a forum post here with one of our developers that should break this down even further for you.

image

rjdavis3 commented 3 years ago

Alternatively, we can go back to hard-coding default versions that we have tested ourselves per resource (i.e. orders at orders endpoint defaults to 2020-07, products endpoint defaults to 2019-10 but you an always overwrite this using the withApiVersion in the builder.

rjdavis3 commented 3 years ago

We should also add withApiVersion to the README since it is not there right now.