Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Use @discardableResult consistently on completion-handler methods

Open Beginner friendly
#466 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
api

Research direction

Start by locating OpenAIProtocol, ResponsesEndpointProtocol, OpenAI, and ResponsesEndpoint, then inspect their completion-handler methods returning CancellableRequest. Add @discardableResult consistently to those methods and run swift package diagnose-api-breaking-changes; the command should report no API breaking changes.

Written by the indexing model from the issue text.

Description

Completion-handler methods return a CancellableRequest, which callers often don't need. Whether discarding it produces an "unused result" warning currently depends on the method:

Protocol Methods returning CancellableRequest With @discardableResult
OpenAIProtocol 27 24 (missing: audioCreateSpeechStream, audioTranscriptionStream, audioTranscriptionsVerbose)
ResponsesEndpointProtocol 4 0
FilesEndpointProtocol (#401) 5 5

Add @discardableResult to every completion-handler method that returns a CancellableRequest, in the protocols and in the concrete implementations (OpenAI, ResponsesEndpoint). Callers that use the concrete types directly get the same behaviour that way.

Adding @discardableResult is source-compatible: it only removes a warning. Run swift package diagnose-api-breaking-changes to confirm it reports nothing.

Dominant language
Swift
Stars
2.9k
Forks
519
Avg merge
4d 9h
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MacPaw/OpenAI

All issues in MacPaw/OpenAI

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.