File tree Expand file tree Collapse file tree
packages/openapi-ts/src/plugins/valibot/v1/toAst Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @hey-api/openapi-ts " : patch
3+ ---
4+
5+ ** plugin(zod)** : add support for ` .discriminatedUnion() `
Original file line number Diff line number Diff line change 1+ ---
2+ " @hey-api/openapi-ts " : patch
3+ ---
4+
5+ ** plugin(valibot)** : add support for ` .variant() `
Original file line number Diff line number Diff 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 ) ) ;
You can’t perform that action at this time.
0 commit comments