OpenAPITools / OpenAPITools/openapi-generator
[BUG][OBJC] Method definitions to getOfflineState, getReachabilityStatus and setReachabilityStatus: missing from ApiClient implementation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- What's the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
The interface in the header to the generated Objective-C API client declares methods that are missing from the implementation file.
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h#L27
They generate these build warnings:
Method definition for 'getOfflineState' not found
Method definition for 'getReachabilityStatus' not found
Method definition for 'setReachabilityStatus:' not found
Calling these methods crashes with NSInvalidArgumentException.
openapi-generator version
4.3.0
OpenAPI declaration file content or url
Any OpenAPI declaration file including the samples generate the bug.
Command line used for generation
./bin/objc-petstore.sh
Steps to reproduce
Build the generated client library to observe the warnings. Call the methods to observe crashes.
E.g.
OpenApiClient.getOfflineState()
OpenApiClient.getReachabilityStatus()
OpenApiClient.setReachabilityStatus(AFNetworkReachabilityStatus.notReachable)
Related issues/PRs
N/A
Suggest a fix
These methods no longer reside in the ApiClient superclass, AFNetworking's AFHTTPSessionManager which is an AFURLSessionManager subclass itself. They reside in AFNetworkReachabilityManager. It would be best to remove them from the header interface.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h and generate the sample using ./bin/objc-petstore.sh. Compare the declared reachability methods with the generated implementation and verify that the build warnings and runtime crashes are gone when those methods are called.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100