v10.0.4
Highlights
-
New: two-file commands output. Codegen now emits
commands.ts(lean, no schema imports) alongsidecommands-validated.ts(subclasses that attachstatic responseSchema). Consumers swap files (or bundler-alias dev → validated) to opt into response validation without paying bundle cost in prod. Pairs with@block65/rest-client13.0.4 which drops thevalidateResponsesflag 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 andvalidateResponses: truewas a silent no-op for those commands — a real production leak class. -
Fix: array responses now validate as arrays. Endpoints like
Pet[]previously hadstatic responseSchema = petSchema(single Pet, wrong — the response is the whole array). Now emitv.array(petSchema).
Removed
- Static
bodySchema,paramsSchema,querySchemaare no longer attached to generated Command classes. rest-client never read them, and Hono middleware imports schemas directly fromvalibot.tsalready — 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.