Skip to content

Headers are not exported when there is no response content #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
jacobshirley opened this issue Jul 30, 2023 · 1 comment
Closed
1 of 2 tasks

Headers are not exported when there is no response content #1262

jacobshirley opened this issue Jul 30, 2023 · 1 comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@jacobshirley
Copy link

jacobshirley commented Jul 30, 2023

Description

When there is no response content, header types are not exported. I believe this is caused by these lines: https://github.com/drwpow/openapi-typescript/blob/efbc4498ef04ff303ab0804451a701acd7fc5196/packages/openapi-typescript/src/transform/response-object.ts#L13-L14

This affects HEAD requests

Name Version
openapi-typescript 6.3.9
Node.js 20.4.0
OS + version MacOS Ventura

Reproduction

If run openapi-typescript on this example spec: https://gist.github.com/jacobshirley/96f18b0244d927146ef66a09c6110594 - it will not output types for X-Document-Reference. It will output 'never' for the 200 response.

Expected result

It should output the X-Document-Reference type

Checklist

@jacobshirley jacobshirley added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Jul 30, 2023
@drwpow
Copy link
Contributor

drwpow commented Jul 31, 2023

This is a bug, but is a duplicate of #1109, so I’ll close this in favor of that one.

@drwpow drwpow closed this as completed Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

2 participants