test: cover request.params export and fix template install#344
Open
kartikkabadi wants to merge 3 commits into
Open
test: cover request.params export and fix template install#344kartikkabadi wants to merge 3 commits into
kartikkabadi wants to merge 3 commits into
Conversation
Add regression coverage and docs clarifying path-parameter export and Chanfana/Zod version support for cloudflare#286.
commit: |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
request.paramsas OpenAPI path parameters.openapi({ param: ... })guidance and document that path params must not be optional/nullablewranglerto4.107.1so templatenpm installresolves against@cloudflare/workers-typesv4 (wrangler>=4.108peers on workers-types v5)engines.node: ">=22"and document the Node 22 prerequisite/templateContext
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
mainalready exports ordinaryrequest.paramsschemas 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