Skip to content

Commit a13d803

Browse files
Version Packages
1 parent a6329f7 commit a13d803

File tree

5 files changed

+35
-36
lines changed

5 files changed

+35
-36
lines changed

.changeset/famous-ducks-lay.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

.changeset/odd-yaks-love.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/poor-stingrays-remember.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/openapi-ts/CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# @hey-api/openapi-ts
22

3+
## 0.74.0
4+
5+
### Minor Changes
6+
7+
- [#2201](https://github.com/hey-api/openapi-ts/pull/2201) [`ab8cede`](https://github.com/hey-api/openapi-ts/commit/ab8cedefe0ca99492d064dfc191f5445bd8102fb) Thanks [@mrlubos](https://github.com/mrlubos)! - feat(zod): generate a single schema for requests
8+
9+
### Single Zod schema per request
10+
11+
Previously, we generated a separate schema for each endpoint parameter and request body. In v0.74.0, a single request schema is generated for the whole endpoint. It may contain a request body, parameters, and headers.
12+
13+
```ts
14+
const zData = z.object({
15+
body: z
16+
.object({
17+
foo: z.string().optional(),
18+
bar: z.union([z.number(), z.null()]).optional(),
19+
})
20+
.optional(),
21+
headers: z.never().optional(),
22+
path: z.object({
23+
baz: z.string(),
24+
}),
25+
query: z.never().optional(),
26+
});
27+
```
28+
29+
If you need to access individual fields, you can do so using the [`.shape`](https://zod.dev/api?id=shape) API. For example, we can get the request body schema with `zData.shape.body`.
30+
31+
### Patch Changes
32+
33+
- [#2192](https://github.com/hey-api/openapi-ts/pull/2192) [`7a740ed`](https://github.com/hey-api/openapi-ts/commit/7a740ed2007b81c0088f4d80dd3401c9af673767) Thanks [@Daschi1](https://github.com/Daschi1)! - fix(valibot): use `isoTimestamp` instead of `isoDateTime` for date-time format
34+
35+
- [#2201](https://github.com/hey-api/openapi-ts/pull/2201) [`a889c3c`](https://github.com/hey-api/openapi-ts/commit/a889c3c899b54aec73a3ecffc071a412b44c112a) Thanks [@mrlubos](https://github.com/mrlubos)! - fix(parser): do not mark schemas as duplicate if they have different format
36+
337
## 0.73.0
438

539
### Minor Changes

packages/openapi-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hey-api/openapi-ts",
3-
"version": "0.73.0",
3+
"version": "0.74.0",
44
"description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.",
55
"homepage": "https://heyapi.dev/",
66
"repository": {

0 commit comments

Comments
 (0)