-
Notifications
You must be signed in to change notification settings - Fork 460
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
Change the type of FileUpload's Links fld to FileLinkList #652
Change the type of FileUpload's Links fld to FileLinkList #652
Conversation
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.
@spastorelli-stripe Thanks a lot for fixing. I left a minor comment, but once fixed you can re-assign to brandur and he'll take reviewing/releasing
filelink.go
Outdated
@@ -53,7 +53,7 @@ func (c *FileLink) UnmarshalJSON(data []byte) error { | |||
return nil | |||
} | |||
|
|||
// FileLinkList is a list of file links as retrieved from a list endpoint. | |||
// FileLinkList is a list object for file links. |
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 think we should keep that comment since we tried to make it consistent across packages
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.
Makes sense. Reverted to the original comment.
@@ -47,7 +47,7 @@ type FileUpload struct { | |||
Created int64 `json:"created"` | |||
ID string `json:"id"` | |||
Filename string `json:"filename"` | |||
Links []*FileLink `json:"links"` | |||
Links *FileLinkList `json:"links"` |
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.
Nice catch, totally missed that one when I shipped the FileLink resource
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 can't get the credit on this one as I didn't catch this. I only came across as it was reported in a ticket.
Geeze, I should've caught that one on review too. Thanks @spastorelli-stripe! Let me know if you've taken a look at Remi's comment, but will get this released ASAP after. |
fe78297
to
9b107d7
Compare
Thanks @remi-stripe and @brandur-stripe for your reviews. I believe I have addressed Remi's comment. PTAL |
Thanks @spastorelli-stripe. Even though this is an interface change, I'm going to release this as a patch because I don't think that the list of file links could ever have successfully deserialized into |
Released as 40.0.2. |
* Move postmessage domain generation to functional style * Minor code cleanup * Improvements to poll timestamp setup * Fixing typing error * Moving customer sanitization to sanitizer * Drop dependabot to weekly to save CI time * Shipping transformation fix * Adding missing fields on customer test
The
Links
field ofFileUpload
struct is currently set to[]*FileLink
.This can cause an unmarshalling error when calling for example the Create FileUpload method, as the
FileUpload
object return as response can include a list of file links:This PR attempts to fix this issue by changing the type of FileUpload's Links fld to
FileLinkList
.r? @ob-stripe @brandur-stripe
cc @stripe/api-libraries