Skip to content
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

This func should be mutating func #126

Merged
merged 3 commits into from
Apr 29, 2021
Merged

This func should be mutating func #126

merged 3 commits into from
Apr 29, 2021

Conversation

varungakhar
Copy link
Contributor

@varungakhar varungakhar commented Apr 22, 2021

Screenshot 2021-04-22 at 1 13 27 PM

@Andrewangeta
Copy link
Member

What the actual issue here? The screenshot you posted has no context?

@varungakhar
Copy link
Contributor Author

when i am trying to create file , i am getting this error
request.stripe.files.create(file: document_id, purpose: .identityDocument)

@Andrewangeta
Copy link
Member

What's the actual error? None of the other functions on any other API route needs to be a mutating func so why is this one the exception? I need a clear error as to what's actually happening first.

@Andrewangeta
Copy link
Member

I see, it's because the implementation itself is a mutating func because it modifies the headers property in the struct itself but the protocol extension isn't mutating.

@@ -17,7 +17,7 @@ public protocol FileRoutes {
/// - purpose: The purpose of the uploaded file. Possible values are `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `identity_document`, `pci_document`, or `tax_document_user_upload`.
/// - fileLinkData: Optional parameters to automatically create a file link for the newly created file.
/// - Returns: A `StripeFile`.
func create(file: Data, purpose: StripeFilePurpose, fileLinkData: [String: Any]?) -> EventLoopFuture<StripeFile>
mutating func create(file: Data, purpose: StripeFilePurpose, fileLinkData: [String: Any]?) -> EventLoopFuture<StripeFile>
Copy link
Member

Choose a reason for hiding this comment

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

Small indentation here.

@Andrewangeta Andrewangeta merged commit ce83ea7 into vapor-community:master Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants