Skip to content

v10.0.4

Choose a tag to compare

@maxholman maxholman released this 11 May 05:30
· 17 commits to master since this release

Highlights

  • New: two-file commands output. Codegen now emits commands.ts (lean, no schema imports) alongside commands-validated.ts (subclasses that attach static responseSchema). Consumers swap files (or bundler-alias dev → validated) to opt into response validation without paying bundle cost in prod. Pairs with @block65/rest-client 13.0.4 which drops the validateResponses flag and validates whenever a schema is present.

  • Fix: inline 2xx response schemas no longer silently skipped. Operations whose 2xx body is an inline object with nested \$refs (e.g. { user: { \$ref: \"...\" } }) now correctly emit a per-command response schema. Previously the codegen fell through and validateResponses: true was a silent no-op for those commands — a real production leak class.

  • Fix: array responses now validate as arrays. Endpoints like Pet[] previously had static responseSchema = petSchema (single Pet, wrong — the response is the whole array). Now emit v.array(petSchema).

Removed

  • Static bodySchema, paramsSchema, querySchema are no longer attached to generated Command classes. rest-client never read them, and Hono middleware imports schemas directly from valibot.ts already — they were pure bundle overhead.

Generated output

  • Namespace imports (import * as commands / import * as schemas) in the validated file keep diffs stable across regenerations.

Dependencies

  • Peer dep: @block65/rest-client ^13.0.3 (required for schema-presence-driven validation).
  • Misc dep rollforward: valibot 1.4, hono 4.12.18, etc.

Note on versioning

Strictly this should be a major bump (peer dep range moved 12 → 13, generated output changed). Released as a patch given a single pre-launch consumer.