swagger-api / swagger-api/swagger-codegen
[Objc] Request specific headers
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I need to add an authorization header to each request. This header is generated for every request.
I would normally do so by subclassing AFHTTPRequestSerializer, this is not an option since the request serializer is being recreated before request : see.
Is there another way to do it ?
Swagger-codegen version
Version : 2.3.0
Suggest a Fix
I'm working on a fix, I'll submit a PR later.
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 the generated ObjC client in samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m, especially the request-serializer setup around lines 258-270. Trace how the serializer is recreated for each request and determine how a generated client can supply a per-request authorization header. Done means the requested header can be generated and applied to every request without relying on a serializer subclass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- api, authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100