ts-json-schema-generator
typeconv
Our great sponsors
ts-json-schema-generator | typeconv | |
---|---|---|
11 | 3 | |
1,303 | 397 | |
3.6% | - | |
9.1 | 4.1 | |
7 days ago | 11 months ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
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.
ts-json-schema-generator
-
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
-
Testing in production: using JSON Schema for 3rd party API response validation
Most people do not write JSON Schema by hand. Typescript is one of the popular tools: https://github.com/vega/ts-json-schema-generator
-
Is it possible to create an array union types as values?
Such as with https://github.com/vega/ts-json-schema-generator#current-state
typeconv
-
Publishing Rust types to a TypeScript frontend
So I'm assuming you're talking about generating Rust types from TypeScript? If you can get your typescript definitions into OpenAPI (i.e, via typeconv) you can use the openapi generator cli to generate rust types. However this is geared towards web backends rather than pure IPC or cross-lang interop.
-
How do you "stitch & glue" types for all your needs?
The class-validator / class-transform looks really nice for formatting/validation but there is also joi. suretype is attractive since theoretically typeconv could generate jsonSchema for json-schema-faker and Open API docs.
-
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
What are some alternatives?
zod-to-json-schema - Converts Zod schemas to Json schemas
suretype - Typesafe JSON (Schema) validator
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
class-transformer - Decorator-based transformation, serialization, and deserialization between objects and classes.
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
JSON-Schema Faker - JSON-Schema + fake data generators
typescript-json-validator - Automatically generate a validator using JSON Schema and AJV for any TypeScript type.
spot - Spot is a concise, developer-friendly way to describe your API contract.
Snowplow - The enterprise-grade behavioral data engine (web, mobile, server-side, webhooks), running cloud-natively on AWS and GCP
sidewinder - Type Safe Micro Services for Node
zod - TypeScript-first schema validation with static type inference
joi - The most powerful data validation library for JS [Moved to: https://github.com/hapijs/joi]