Skip to content

Commit 3d8db90

Browse files
committed
docs: add changesets
1 parent e0f3b28 commit 3d8db90

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.changeset/hip-foxes-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
**plugin(zod)**: add support for `.discriminatedUnion()`

.changeset/moody-wings-punch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
**plugin(valibot)**: add support for `.variant()`

packages/openapi-ts/src/plugins/valibot/v1/toAst/union.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ function baseNode(ctx: UnionResolverContext): PipeResult {
2828
return nonNullItems[0]!.pipes;
2929
}
3030

31+
const itemNodes = nonNullItems.map((i) => pipesToNode(i.pipes, plugin));
32+
3133
const discriminatorKey = parentSchema.discriminator?.propertyName;
3234
if (discriminatorKey) {
33-
const itemNodes = nonNullItems.map((i) => pipesToNode(i.pipes, plugin));
3435
return $(v)
3536
.attr(identifiers.schemas.variant)
3637
.call($.literal(discriminatorKey), $.array(...itemNodes));
3738
}
3839

39-
const itemNodes = nonNullItems.map((i) => pipesToNode(i.pipes, plugin));
4040
return $(v)
4141
.attr(identifiers.schemas.union)
4242
.call($.array(...itemNodes));

0 commit comments

Comments
 (0)