OpenAPITools / OpenAPITools/openapi-generator
[BUG] [Typescript] Response headers are not available.
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?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I want to access the response headers for an E-tag. In the openAPI yaml file, the headers are defined for the response but it doesn't generate anything to access them
responses:
'200':
description: Resource returned OK.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlHeader'
ETag:
$ref: '#/components/headers/ETagHeader'
Version:
$ref: '#/components/headers/VersionHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/....'
the header is defined as follows:
ETagHeader:
description: 'Caching: An opaque string which identifies a specific version of the returned resource.'
schema:
type: string
The problem with the headers in the response not being accessible (especially E-tag) seems to be faced by other typescript-xxx client generators https://github.com/OpenAPITools/openapi-generator/issues/6527
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 TypeScript client generators and the supplied OpenAPI response definition, then inspect how generated responses expose headers. Confirm the behavior across the affected typescript-xxx generator and add access to the ETag and other declared headers; done means a generated client can read them from the response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100