swagger-api / swagger-api/swagger-codegen-generators

[PHP] Default headers should be configurable

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

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

At present there's no way to inject default headers. There are instances when you may wish to include additional headers that aren't defined by the Swagger Documentation, perhaps for debugging or slight differences in API flows.

The default empty $headers array should be configurable.

See: https://github.com/swagger-api/swagger-codegen-generators/blob/458be6c0da3a6d7f7d4049f60d8f21cb1edf163b/src/main/resources/handlebars/php/HeaderSelector.mustache#L41

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 src/main/resources/handlebars/php/HeaderSelector.mustache at line 41, where the default empty headers array is defined. Trace how this template is used for generated PHP clients and verify that the resulting clients can accept additional default headers without losing documented headers.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.