Skip to content

Commit

Permalink
Merge pull request #283 from hey-api/fix/service-response-export
Browse files Browse the repository at this point in the history
fix(client): export APIResult when using serviceResponse as 'response'
  • Loading branch information
jordanshatford authored Apr 7, 2024
2 parents 801fb25 + 515aaed commit b795730
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-owls-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hey-api/openapi-ts": patch
---

fix(client): export APIResult when using serviceResponse as 'response'
3 changes: 3 additions & 0 deletions packages/openapi-ts/src/utils/write/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const writeClientIndex = async (client: Client, outputPath: string, confi
}
if (config.exportCore) {
file.push(compiler.export.named('ApiError', './core/ApiError'));
if (config.serviceResponse === 'response') {
file.push(compiler.export.named({ isTypeOnly: true, name: 'ApiResult' }, './core/ApiResult'));
}
if (config.name) {
file.push(compiler.export.named('BaseHttpRequest', './core/BaseHttpRequest'));
}
Expand Down

0 comments on commit b795730

Please sign in to comment.