cloudflare/chanfana v3.2.0
cloudflare/chanfana
Captured source
source ↗published Feb 26, 2026seen 5dcaptured 8hhttp 200method plain
v3.2.0
Repository: cloudflare/chanfana
Tag: v3.2.0
Published: 2026-02-26T19:35:07Z
Prerelease: no
Release notes:
Minor Changes
- #323 `d9b7297` Thanks @G4brym! - Add
handleErrorhook,defaultOrderByDirection, fix validation error format and D1 update with extra columns
- Add
handleError(error)protected method onOpenAPIRouteto transform errors before chanfana formats them. Enables custom error wrapping (e.g., bypassing chanfana's formatter to use Hono'sonError).
- Add
defaultOrderByDirectionproperty toListEndpoint(defaults to"asc"). Allows configuring the default sort direction whenorderByFieldsis used.
- Breaking: Validation errors from
validateRequest()now returnInputValidationExceptionformat instead of raw Zod issues. This makes the actual response match the OpenAPI schema that chanfana documents. If you parse validation error responses, update your code to use the new shape:
Before:
{
"errors": [
{
"code": "invalid_type",
"expected": "string",
"received": "number",
"message": "Invalid input: expected string, received number",
"path": ["body", "name"]
}
],
"success": false,
"result": {}
}After:
{
"errors": [
{
"code": 7001,
"message": "Invalid input: expected string, received number",
"path": ["body", "name"]
}
],
"success": false,
"result": {}
}Key differences: code is now the numeric 7001 (was a string like "invalid_type"), and Zod-specific fields (expected, received) are no longer included.
D1UpdateEndpoint.update()now automatically filtersupdatedDatato only include columns defined in the Zod schema. Previously, DB tables with extra columns not in the schema would causevalidateColumnName()to throw.
Notability
notability 3.0/10Routine minor release.