Skip to content

Commit

Permalink
Changelog: 18.5.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed May 4, 2024
1 parent 6bbcb8a commit 30909f8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

## Version 18

### v18.5.0

- Major update on metadata: ~~`withMeta()`~~ is no longer required, deprecated and will be removed in v19:
- ~~`withMeta()`~~ was introduced in version 2.10.0, because I didn't want to alter Zod's prototypes;
- However, the [new information](https://github.com/colinhacks/zod/pull/3445#issuecomment-2091463120) arrived
recently from the author of Zod on that matter;
- It turned out that altering Zod's prototypes is exatly the recommended approach for extending its functionality;
- Therefore `express-zod-api` from now on acts as a plugin for Zod, adding the `.example()` and `.label()` methods to
its prototypes that were previously available only after wrapping the schema in ~~`withMeta()`~~.

```ts
import { z } from "zod";
import { withMeta } from "express-zod-api";

const before = withMeta(
z
.string()
.datetime()
.default(() => new Date().toISOString()),
)
.example("2024-05-04T10:47:19.575Z")
.label("Today");

```

### v18.4.0

- Ability to replace the default value with a label in the generated Documentation:
Expand Down

0 comments on commit 30909f8

Please sign in to comment.