zod-to-json-schema
Converts Zod schemas to Json schemas (by StefanTerdell)
ts-json-schema-generator
Generate JSON schema from your Typescript sources (by vega)
zod-to-json-schema | ts-json-schema-generator | |
---|---|---|
3 | 13 | |
1,127 | 1,579 | |
4.7% | 1.8% | |
8.3 | 9.3 | |
5 days ago | 4 days ago | |
TypeScript | TypeScript | |
ISC License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
zod-to-json-schema
Posts with mentions or reviews of zod-to-json-schema.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-01-25.
-
Next.js and GPT-4: A Guide to Streaming Generated Content as UI Components
Zod and GPT-4 Zod is great for generating typed JSON from GPT-4, because you can easily convert Zod schemas to JSON schemas using zod-to-json-schema and include descriptions for each property. The JSON schemas are passed to GPT-4 as function definitions or in the prompt (when you are using JSON mode).
- JSON Schema Store
-
Types to JSON Schemas
https://github.com/StefanTerdell/zod-to-json-schema#readme
ts-json-schema-generator
Posts with mentions or reviews of ts-json-schema-generator.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-12-05.
-
Creating a 3D config with types
JSON is simple and flexible, but has no typing information. Sure it is possible to join a JSON schema file, but that needs to be taken care of and checked. Ex, with additional tooling like typescript-json-schema or ts-json-schema-generator.
-
TypeSpec: A New Language for API-Centric Development
This looks interesting but I already have TypeScript types for my APIs so I developed https://github.com/vega/ts-json-schema-generator which lets me generate JSON schema from the sources directly. Yes, it does have some oddities because the two languages have slightly different feature sets but it’s been working well for us for a few years. If I didn’t have TypeScript or a smaller API surface I’d be okay with typing again I would look at TypeSpec though. It definitely beats writing JSON schema by hand.
-
Automating API Documentation: A Journey from TypeScript to OpenAPI and Schema Governence with Optic
3. Generate JSON schemas with the ts-json-schema-generator package
-
Is using zod as the primary source of truth for Typescript types sensible/sustainable?
We user ts-json-schema-generator to create the schemas directly from TS types.
-
Validating JSON parser that uses TS as the spec format?
I’ve been using this one: https://github.com/vega/ts-json-schema-generator most recently and it’s been great
-
Transpiling Typescript into Rust
Maybe this vscode extension can work for you. It can turn Json samples into structs. this can help you turn typescript to Json. Maybe you can automate it.
-
Game engine in web - part 2 - data oriented system
Now we have to parse the JSON containing our scene and validate that this JSON is valid according to what we expect. For that we are going to use the JSON Schema along with ts-json-schema-generator to generate said schema automatically and ajv to validate JSON against the generated schema.
-
Is there a tool to visualize all of the value-types of a highly abstracted interface/type?
If the output format isn’t important you could use ts-json-schema-generator - it doesn’t work with everything but it’s pretty good at outputting a json schema structure for interfaces and types.
-
Anyone using decorators, or some other form of inline documentation, to generate an openapi spec file based on a typescript library?
https://github.com/grantila/typeconv/ https://github.com/airtasker/spot https://github.com/vega/ts-json-schema-generator
- TypeScript runtime type-checking - designed for simple use, through to enforcing API payload schema
What are some alternatives?
When comparing zod-to-json-schema and ts-json-schema-generator you can also consider the following projects:
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
quicktype - Generate types and converters from JSON, Schema, and GraphQL
typescript-json-validator - Automatically generate a validator using JSON Schema and AJV for any TypeScript type.
RxDB - A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
spot - Spot is a concise, developer-friendly way to describe your API contract.