Skip to content

fix(cli): emit RequestModel schema leaves and type-only imports - #146

Merged
prc5 merged 1 commit into
mainfrom
fix/cli-sdk-request-model
Oct 7, 2026
Merged

prc5 merged 1 commit into
mainfrom
fix/cli-sdk-request-model

Conversation

@prc5

@prc5 prc5 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #145.

  • Generated SDK schema leaves now use RequestModel<{ response; payload; queryParams; error; endpoint }>, matching the SDK docs. Absent fields are omitted; optional query params become queryParams?:.
  • ClientInstance and RequestModel are imported with import type, so the generated file compiles with verbatimModuleSyntax enabled.
  • SdkSchema no longer takes a Client generic. Core's createSdk injects the client into every leaf, so the parameter was redundant. If you referenced SdkSchema<typeof client> in your own code, drop the argument.
  • Updated the generator test expectations and the CLI README sample output.

Test plan

  • pnpm vitest run in packages/cli (35 passed)
  • oxlint and tsc --noEmit on the CLI package
  • Generated files from both v3 fixtures and compiled them, plus a typed usage calling sdk.pet.$petId.$get, with strict and verbatimModuleSyntax enabled against the built core package

🤖 Generated with Claude Code

The generated SDK file now describes each endpoint with
`RequestModel<{ ... }>` as documented, instead of a raw `Request<...>`
with positional generics. `ClientInstance` and `RequestModel` are
imported with `import type`, so the output compiles under
`verbatimModuleSyntax`. `SdkSchema` drops its `Client` generic because
`createSdk` injects the client into every leaf.

Closes #145

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@prc5
prc5 requested a review from GerasNyx as a code owner October 7, 2026 18:25
@prc5
prc5 merged commit e91e8a3 into main Oct 7, 2026
4 checks passed
@prc5
prc5 deleted the fix/cli-sdk-request-model branch October 7, 2026 18:30
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 9.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update SDK generator output to use RequestModel and fix type imports for verbatimModuleSyntax

1 participant