New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flag to skip types that are not supported #157
Comments
Or I would like support for interfaces with generics. |
This would make the library much more compatible with other code generator libraries as very many of them use generics and other unsupported types for their own typings. Plzplz!! |
I found a way to get around this using the |
This has again become an issue when introducing discriminators in the swagger contract. The typescript types are then created with generics. Please add an option to not fail the generation when an error occurs! --skip-unsupported or something. |
Can you create a PR that implements this? |
Also in need of a skip flag but do not have the bandwidth to create a PR for this. |
Hello, Can you provide an example of a few failing cases (besides generic types)? The first example provided export type QueryParamsType = Record<string | number, any>; currently generates // Generated by ts-to-zod
import { z } from "zod";
export const queryParamsTypeSchema = z.record(
z.union([z.string(), z.number()]),
z.any()
); so I see no error to "skip" in that specific example. |
Feature description
I am trying to generate zod schemas from the Api generated by swagger-typescript-api. But this API contains a bunch of unsupported types related to the API it self which i don't really need zod-schemas for. Like Interface with generics etc.
I would like to be able to give a flag to the ts-to-zod command so the script doesn't exit when it find an unsupported type, e.g:
npx ts-to-zod src/myApi.ts src/myZodApi.ts --skip-unsupported
Input
Output
// nothing
The text was updated successfully, but these errors were encountered: