postmanlabs / postmanlabs/postman-code-generators

Go-Template and Casing in name of header

Open
#427 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen
Dominant language
JavaScript
Stars
1k
Forks
381
PR merge metrics
No merged PRs in 30d

Description

The go template change the casing of header names.

req.Header.Add("SOAPAction", "MyHeader")

will result in: Soapaction: MyHeader

The template should use this instead to preserve the casing:

req.Header["SOAPAction"] = []string{"MyHeader"}

See: https://github.com/postmanlabs/postman-code-generators/blob/bb5f6ff7ed495536bc447ab69afcc2852ae65304/codegens/golang/lib/index.js#L163

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

Inspect codegens/golang/lib/index.js around line 163, where the Go request template handles headers. Compare the generated output for SOAPAction with the reported examples and verify that the completed template preserves header-name casing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.