ts-json-schema-generator
ts2c
ts-json-schema-generator | ts2c | |
---|---|---|
12 | 5 | |
1,312 | 1,220 | |
2.8% | - | |
9.2 | 0.0 | |
9 days ago | about 1 year ago | |
TypeScript | C | |
MIT License | ISC 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
-
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
-
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
ts2c
-
Microsoft DeviceScript – TypeScript for Tiny IoT Devices
These are far from perfect, but still something:
https://github.com/andrei-markeev/ts2c/
https://github.com/evanw/thinscript
If you aim for 32 bit microcontrollers then you can go with assemblyscript to wasm and then with wasm to C transpiller
-
TurboFan is an amazing piece of work
just wait bro, when silicon reaches the limits the electron team gonna take this over https://github.com/andrei-markeev/ts2c and pray they can use less ram somehow
-
Transpiling Typescript into Rust
Since you're going to need to manually adjust the output anyway, you could see if chaining ts2c and c2rust does something useful to you.
-
An amazing error message if you put more than 2^24-1 items in a JS Map object
TypeScript doesn't need a code generator with a special syntax in order to compile it into C. You can in fact compile TypeScript into C if you want: https://github.com/andrei-markeev/ts2c
-
Maintainers [...] are moving *AWAY* from [...] TypeScript, just at the same time when the wider dev world is falling in love with TS
lol no ts2c https://github.com/andrei-markeev/ts2c
What are some alternatives?
zod-to-json-schema - Converts Zod schemas to Json schemas
wax - A tiny programming language that transpiles to C, C++, Java, TypeScript, Python, C#, Swift, Lua and WebAssembly 🚀
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
mjs - Embedded JavaScript engine for C/C++
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
devicescript - TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
typescript-json-validator - Automatically generate a validator using JSON Schema and AJV for any TypeScript type.
bun - A fast all-in-one JavaScript runtime [Moved to: https://github.com/oven-sh/bun]
typeconv - Convert between JSON Schema, TypeScript, GraphQL, Open API and SureType
nano-ycmd - Modded GNU Nano using ycmd code completion and IntelliSense. The ycmd code completion support for nano is found in the ymcd-code-completion branch.
Snowplow - The enterprise-grade behavioral data engine (web, mobile, server-side, webhooks), running cloud-natively on AWS and GCP
lowjs - A port of Node.JS with far lower system requirements. Community version for POSIX systems such as Linux, uClinux or Mac OS X.