swagger-api / swagger-api/swagger-codegen

[Objc] Request specific headers

Open
#4,127 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Objc Enhancement: Feature help wanted
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

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.