typescript-json-schema
ts-rs
Our great sponsors
typescript-json-schema | ts-rs | |
---|---|---|
9 | 5 | |
3,030 | 919 | |
- | 5.3% | |
6.3 | 9.6 | |
23 days ago | 5 days ago | |
TypeScript | Rust | |
BSD 3-clause "New" or "Revised" 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.
typescript-json-schema
-
6 Reasons why JSON Schema is worth your time
Typescript to JSON Schema
-
Parse, Don't Validate (2019)
For anyone using both TypeScript and JSON schemas, but wanting to use TypeScript as the source of truth, I highly recommend the following library: [ts-json-schema-generator](https://github.com/YousefED/typescript-json-schema).
It does exactly what it says in the box: turns your TypeScript `types` / `interface` into machine-readable JSON schemas.
The library has a few open issues (does not deal well with some edge cases of composing Omit<> on sum types, and does not support dynamic (const) keys), but compared to manually writing JSON schemas, it's been amazing!
-
Is it possible to validate a json only according to a type? [node with typescript]
There are a bunch of tools to generate JSON-schema from a TS codebase, ie https://github.com/YousefED/typescript-json-schema
-
Input validation in Express from TypeScript
Now that cool thing we wanted to do? This library does exactly that!
-
YAML: It's Time to Move On
> For more complex cases I find myself wishing I could just turn Typescript into some kind of schema validation for JSON.
Not sure if this is what you're looking for, and whether it's powerful and expressive enough for your use case, but you can use typescript-json-schema¹ for this, and validate with eg ajv.
¹https://github.com/YousefED/typescript-json-schema
-
ts-rs - generate typescript type declarations from rust types
Use https://github.com/YousefED/typescript-json-schema to go from TS -> json schema
-
What can I *use* Rust for?
For what it's worth, thanks to TypeScript transformers (a feature baked into the compiler), one can create a transformer library that verifies an object is valid for any TypeScript type and conveys that information to the typechecker. And indeed, it's already been made. It allows to parse unknown into a given T. This is nice, because one can generate a JSON schema out of a TS type, for other languages/codebases to integrate safely.
-
JSON Schema bundling finally formalised
This is why I originally started a project to convert ts to json schema; https://github.com/YousefED/typescript-json-schema (and also check out a good alternative https://github.com/vega/ts-json-schema-generator)
-
How to use typescript & sails js for your REST API (Safer seas)
Typescript JSON schema
ts-rs
-
Differential: Type safe RPC that feels like local functions
I agree, and disagree.
I agree that it limits the usage of the tool in a polygot environment. I disagree it's a downside.
The absence of an intermediary language does give some benefits to the first class citizen (in this case, Typescript).
However, there are some other developments [1] which attempt to make the Typescript type system an IDL to allow for better interop.
[1] https://github.com/Aleph-Alpha/ts-rs
- Generate TypeScript interface/type declarations from rust types
-
What’s the best high-level companion to Rust?
Not the person you asked, but I’ve seen people use https://github.com/Aleph-Alpha/ts-rs to generate TS interfaces at compile time for use on the frontend. Saves a bunch of time when scaffolding up a new data model without having to use a custom gRPC plugin or something wonky like that. That makes Rust and TS a pretty powerful pairing IMO.
-
ts-rs - generate typescript type declarations from rust types
[Link]
-
Hey Rustaceans! Got an easy question? Ask here (42/2021)!
Does anyone know how mature ts-rust is? I'm trying to use this with complex types (nested enums etc) and am running into some pain-points, especially when I have types defined across multiple files. Not sure if this is a legitimate limitation, or whether there's just more for me to do in terms of configuration etc.
What are some alternatives?
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
rust-analyzer - A Rust compiler front-end for IDEs
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
typebinder - Exports TS definitions from Rust module
ron - Rusty Object Notation
card_game
SailsJS - Realtime MVC Framework for Node.js
tsync - Thread Synchronization and message passing in python.
dhall-lang - Maintainable configuration files
combine - A parser combinator library for Rust
io-ts - Runtime type system for IO decoding/encoding
schemafy - Crate for generating rust types from a json schema