apple / apple/swift-http-api-proposal
Should options be a non-optional parameter
- Dominant language
- Swift
- Stars
- 66
- Forks
- 21
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 2
Description
In this PR, we make it optional: https://github.com/apple/swift-http-api-proposal/pull/97/changes
But we also discussed making it non-optional in the requested perform method on the protocol, and then adding default implementation to the protocol extension that just excludes the options parameter, and provides the result of `self.makeDefaultOptions()`.
I think that's a nicer spelling as it allows adopters to rely on the fact that omitting the parameter will always match the behavior to explicitly calling `client.makeDefaultOptions()`. Plus it avoids potential confusion about "what does nil represent here" (which has historically been non-trivial for things like completion queues, etc).
Contributor guide
Assessment
This issue has not been assessed yet.