-
-
Notifications
You must be signed in to change notification settings - Fork 37
v25: example is not a function #2981
Copy link
Copy link
Labels
breakingBackward incompatible changesBackward incompatible changesgood first issueGood for newcomersGood for newcomershacktoberfest-acceptedThe PR is a valuable contribution according to Hacktoberfest guidelinesThe PR is a valuable contribution according to Hacktoberfest guidelines
Metadata
Metadata
Assignees
Labels
breakingBackward incompatible changesBackward incompatible changesgood first issueGood for newcomersGood for newcomershacktoberfest-acceptedThe PR is a valuable contribution according to Hacktoberfest guidelinesThe PR is a valuable contribution according to Hacktoberfest guidelines
Description
Upgrading from v24 to v25 appears to break examples in generated documentation. I created a git repo which reproduces this issue: https://github.com/squishykid/express-zod-api-example-issue
There are two ways this library allows developers to provide examples:
.example().meta()Upon upgrading from 24.7.3 to 25.0.0 it appears that both of these methods of providing examples break in different ways.
Examples supplied via the .meta() method simply vanish silently from the generated documentation. Perhaps zod's
globalRegistryis not as global any more? I notice that examples (default error messages) added by this library continue to be included in the documentation yaml output.Examples supplied via the
.example()method cause a compile error after upgrading from v24.7.3 to v25.0.0:Expected
I would have expeted
.example()and.meta()to both produce examples in the documentation output, regardless of using v24.x or v25.x of this library.Reproduction
I have created a repository here which extends a previous minimal example for zod bugs.
The repo currently uses v24.7.3, but upon upgrading to v25.0.0 the bug will be triggered.
https://github.com/squishykid/express-zod-api-example-issue
Context
express-zod-apiversion: v24.7.3 to v25.0.0