You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the input sample data is an array, e.g a single sample input of:
[{"key":"one"},{"key":"two"}]
The generated code for most languages like Go/Rust/Haskell/C# etc will logically be a Vec/List/array etc.
But when using output language typescript-zod, it does NOT generate a Zod schema/type that is an array, only a schema/type for the internal array element type.
This is inconsistent with other languages, and makes it very hard to use the lib in a consistent way when you're expecting the generated types to match the sample data you gave it.
Simple arrays of scalars produce nothing at all
Additionally... if you give an input that is a simple array of scalar values, e.g:
[1,2,3]
or
["a","b","c"]
...then absolutely no code is generated at all, aside from the import at the top: import * as z from "zod";
When the input sample data is an array, e.g a single sample input of:
The generated code for most languages like Go/Rust/Haskell/C# etc will logically be a Vec/List/array etc.
But when using output language
typescript-zod
, it does NOT generate a Zod schema/type that is an array, only a schema/type for the internal array element type.This is inconsistent with other languages, and makes it very hard to use the lib in a consistent way when you're expecting the generated types to match the sample data you gave it.
Simple arrays of scalars produce nothing at all
Additionally... if you give an input that is a simple array of scalar values, e.g:
or
...then absolutely no code is generated at all, aside from the import at the top:
import * as z from "zod";
Context (Environment, Version, Language)
Input Format:
JSON
Output Language:
typescript-zod
I'm seeing this:
"quicktype-core": "^23.0.171"
Expected Behaviour / Output
Current Behaviour / Output
Steps to Reproduce
[1,2,3]
-or-[{"key":"one"},{"key":"two"}]
TypeScript Zod
The text was updated successfully, but these errors were encountered: