ReleaseCloudflare (Workers AI)Cloudflare (Workers AI)published Feb 26, 2026seen 5d

cloudflare/chanfana v3.2.0

cloudflare/chanfana

Open original ↗

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 handleError hook, defaultOrderByDirection, fix validation error format and D1 update with extra columns
  • Add handleError(error) protected method on OpenAPIRoute to transform errors before chanfana formats them. Enables custom error wrapping (e.g., bypassing chanfana's formatter to use Hono's onError).
  • Add defaultOrderByDirection property to ListEndpoint (defaults to "asc"). Allows configuring the default sort direction when orderByFields is used.
  • Breaking: Validation errors from validateRequest() now return InputValidationException format 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 filters updatedData to only include columns defined in the Zod schema. Previously, DB tables with extra columns not in the schema would cause validateColumnName() to throw.

Notability

notability 3.0/10

Routine minor release.