-
Notifications
You must be signed in to change notification settings - Fork 294
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
Support Encodable
POST types
#1151
Conversation
…ble vs dictionary
|
||
var metadataContainer = encoder.container(keyedBy: MetadataKeys.self) | ||
if httpType == .gateway { | ||
let metadataEncoder = metadataContainer.superEncoder(forKey: .gatewayMetadataKey) |
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.
TIL about superEncoder
- super cool!
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.
Yeh, it was a little tricky to figure out how to do this, but this stack overflow post is what helped me - https://stackoverflow.com/questions/50461744/swift-codable-how-to-encode-top-level-data-into-nested-container
UI test failures unrelated |
Why
.swift
files to house POST formattingSummary of changes
BTApplePaymentTokensRequest
encodable typeBTAPIClient.post(parameters: Encodable, ...)
BTAPIRequest
struct which represents the final end-state of the POST body for GW & GraphQL API requestsBTClientMetadata
toEncodable
Checklist
Added a changelog entryAuthors
@scannillo