Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add January 2021 API version #117

Merged
merged 1 commit into from
Mar 1, 2021
Merged

Add January 2021 API version #117

merged 1 commit into from
Mar 1, 2021

Conversation

paulomarg
Copy link
Contributor

WHY are these changes introduced?

Fixes #116

The 2021-01 API version was missing from the version options.

WHAT is this pull request doing?

Adding the missing version.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

@paulomarg paulomarg requested a review from a team as a code owner March 1, 2021 14:14
@paulomarg paulomarg force-pushed the add_jan_2021_version branch from 76a75f9 to 79e778b Compare March 1, 2021 14:15
Copy link
Contributor

@mllemango mllemango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we want to implement something similar to the python library where we can automatically fetch the API versions? https://github.com/Shopify/shopify_python_api/blob/master/shopify/api_version.py#L30

@paulomarg
Copy link
Contributor Author

Fetching the versions is interesting, but I don't think we can define a Typescript type around a network request - the type needs to be defined at transpilation time, before we have a chance to run the request.

@paulomarg paulomarg merged commit 89ea780 into main Mar 1, 2021
@paulomarg paulomarg deleted the add_jan_2021_version branch March 1, 2021 15:03
@furnaceX
Copy link

furnaceX commented Mar 1, 2021

Fetching the versions is interesting, but I don't think we can define a Typescript type around a network request - the type needs to be defined at transpilation time, before we have a chance to run the request.

I had read that the Ruby shopify-api package so I had expected that this package worked similarly. Perhaps there is a method that can be adopted from that package?
https://github.com/Shopify/shopify_api#breaking-change-notice-for-version-800

Version 7.0.0 introduced ApiVersion, and known versions were hardcoded into the gem. Manually defining API versions is no longer required for versions not listed in the gem.

@paulomarg
Copy link
Contributor Author

I don't think it would work as far as defining a type goes, since I don't think we'd be able to create a type programatically (Typescript types are 'gone' by the time the code is running).

As someone mentioned on the original issue it should be possible to just use a plain string if the option isn't there. The type just translates that to a more readable format.

We can look into this in the future, as long as people are able to work around missing values in the enum in some way (in this case, using a plain string). If that fails for some reason we can address it as a bug, otherwise it'll be something for the future.

@paulomarg paulomarg temporarily deployed to production March 2, 2021 15:25 Inactive
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Api Versions are out of date
3 participants