-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes invalid typing of discount code errors #1205
Conversation
1626ad3
to
a38e649
Compare
2ec3952
to
0c21e9b
Compare
@@ -324,4 +324,26 @@ def test_9() | |||
end | |||
end | |||
|
|||
sig do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only put this one test in the latest API version, I doubt this is where this test belongs as it's supposed to be auto-generated. Seems to me that the auto-generation of these tests are missing some error cases.
0c21e9b
to
aacd951
Compare
Thanks for your contribution! Unfortunately, these REST resource files are auto generated upstream so we won't be able to merge this in as the next time we generate these resources your fixes will be reverted. Having said that, we can apply your fix upstream! We are working on a few other fixes in this area and will add these to our list! |
@nelsonwittwer Thanks! I'll watch for updates on this issue, appreciate you pulling this in. 👍 |
c128ae0
to
463ae2a
Compare
@nelsonwittwer This has been rebased and everything is passing, is it possible to get this looked at? Thanks! |
Hi there 👋 Sorry for the sluggish responses on this. Tldr; we do want to get this merged. Though we are planning on merging this when the January API release goes out, and apply these changes. |
463ae2a
to
794067c
Compare
hi @garethson , this is great! Would you mind updating the 2024-01 and 2024-04 versions? It'll be nice to apply changes to the latest versions too. |
794067c
to
dbb913c
Compare
Description
Fixes #1202
It appears as though when #1153 was shipped, it set the
errors
type theShopifyAPI::DiscountCode
class to beT.nilable(T::Hash[T.untyped, T.untyped]))
when it should have just been left as the type defined in ShopifyAPI::Rest::Base.As reported by @martinsp, this results in an error when
ShopifyAPI::Rest::Base
attempts to@errors.errors << e
.Note that, specifically in 125b693, the nuance of the
DiscountCode
resource returning a list of serialized errors on a normal fetch was dealt with, but I think that PR then should have removed those explicit definitions from theDiscountCode
class as I have here. The other solution may have been to actually hook in and create aShopifyAPI::Rest::Base
for the returned errors when listing DiscountCodes after a batch create, but that's a deeper change.How has this been tested?
Tested manually and also added a test here. It's unclear to me how these tests are now auto-generated so I suspect my manually added test needs to go ... elsewhere?
Checklist: