Skip to content

test: cover request.params export and fix template install#344

Open
kartikkabadi wants to merge 3 commits into
cloudflare:mainfrom
kartikkabadi:test/request-params-openapi-regression
Open

test: cover request.params export and fix template install#344
kartikkabadi wants to merge 3 commits into
cloudflare:mainfrom
kartikkabadi:test/request-params-openapi-regression

Conversation

@kartikkabadi

@kartikkabadi kartikkabadi commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • add regression coverage for exporting request.params as OpenAPI path parameters
  • cover both OpenAPI 3.0 and 3.1 generation
  • clarify path-parameter naming and Chanfana/Zod version compatibility
  • correct .openapi({ param: ... }) guidance and document that path params must not be optional/nullable
  • pin template wrangler to 4.107.1 so template npm install resolves against @cloudflare/workers-types v4 (wrangler >=4.108 peers on workers-types v5)
  • declare template engines.node: ">=22" and document the Node 22 prerequisite
  • add Dependabot monitoring for /template

Context

Issue #286 was reported using Chanfana 2.8.3 with Zod 4. Chanfana 2.x used Zod 3 and zod-to-openapi 7; current Chanfana 3 uses Zod 4 and zod-to-openapi 8.

Likely cause: the reporter’s unsupported Chanfana 2 + Zod 4 dependency combination. Current main already exports ordinary request.params schemas correctly, so no production-code change is necessary. This PR locks that behavior in with a regression test and documents the supported setup.

The precise failure mechanism in the unsupported Chanfana 2 + Zod 4 environment was not reproduced.

Closes #286

Validation

  • Targeted OpenAPI schema tests
  • Full test suite
  • Lint
  • Build
  • Documentation build
  • Template install / typecheck / tests (local + CI-like resolution)

Add regression coverage and docs clarifying path-parameter export
and Chanfana/Zod version support for cloudflare#286.
@kartikkabadi
kartikkabadi requested a review from G4brym as a code owner July 10, 2026 09:45
@pkg-pr-new

pkg-pr-new Bot commented Jul 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/chanfana@344

commit: c77dbd3

Correct OpenAPI param metadata guidance, require non-optional path
schemas, exercise the public OpenAPIRoute export, and pin template
wrangler to 4.107.1 so npm install stays compatible with workers-types v4.
Add engines/README prerequisites for Wrangler and Dependabot coverage
for /template so the pinned wrangler line stays maintainable.
@kartikkabadi kartikkabadi changed the title test: cover request.params OpenAPI export test: cover request.params export and fix template install Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path parameters defined in request.params not exported to OpenAPI spec parameters array

1 participant