Skip to content

Should options be a non-optional parameter #98

@czechboy0

Description

@czechboy0

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions