@polygonlabs/zod-to-openapi-heyapi@2.0.4
·
8 commits
to main
since this release
Patch Changes
-
#81
c514a10Thanks @MaximusHaximus! - Report 2xx bodies that fail response validation asResponseValidationErrorinstead ofTransportErrorFixed
- A success (2xx) response body that failed
parseAsyncagainst the registered response schema surfaced as aTransportError— the response transformer'sZodErrorwas intercepted by the SDK wrapper's genericinstanceof Errortransport branch, so the single most important thing the codec client detects (a producer's contract drift on a success body) was reported as a network failure. It now surfaces as aResponseValidationErrorcarrying the parse issues (cause) and the offending post-JSON.parsebody (body), in boththrowOnErrormodes and for every wrapper flavour — full error-decoding wrappers, input-only wrappers, and pass-through ops.
Docs
schemasFrom: '#schemas'(apackage.json#importsalias) was documented but has never worked: Node resolves#aliases against the package containing the importing module, and the plugin dynamic-importsschemasFromfrom its own install location, where the consumer's alias is not defined. The README, option JSDoc, and the codegen-time error hint now describe the working pattern for schemas living inside the codegen package — give the package aname+exportsentry, self-link it ("<name>": "link:."in devDependencies), and pass the package's own name.
- A success (2xx) response body that failed