isopod
typescript-json-schema
Our great sponsors
isopod | typescript-json-schema | |
---|---|---|
4 | 9 | |
461 | 3,030 | |
0.4% | - | |
0.0 | 6.3 | |
5 months ago | 24 days ago | |
Go | TypeScript | |
Apache License 2.0 | BSD 3-clause "New" or "Revised" 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.
isopod
-
Jsonnet – The Data Templating Language
Tried it[0], worked reasonably well. Be prepared for strong opposition from traditional “devops” folks “who don’t mind yaml” and will drag everyone down.
[0] - https://github.com/cruise-automation/isopod
- Deploying Kubernetes clusters in increasingly absurd languages
- YAML: It's Time to Move On
-
Cue: A new language for data validation
I like Cue and Jsonnet and Starlark and so on. But all of these have very low mindshare (though Starlark has the most momentum thanks to Bazel), and who knows if they will be dead by next year.
Being an early adopter is difficult both in terms of the immaturity of the tooling — Cue, for example, only has a Go implementation at the moment — and in terms of the risk of betting on an evolutionary dead end, which can cause a lot of unnecessary churn when you want to standardize on something across an entire organization.
As a concrete example, I'd love to replace Kubernetes's use of YAML with something like the above. But the tooling is immature, and almost nobody is using any of it. For example, there's Isopod [1], which is a nice-looking tool to use Starlark with Kubernetes. But it might go the same way as Ksonnet.
[1] https://github.com/cruise-automation/isopod
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
What are some alternatives?
skycfg - Skycfg is an extension library for the Starlark language that adds support for constructing Protocol Buffer messages.
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
cue - The home of the CUE language! Validate and define text-based and dynamic configuration
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
rules_jsonnet - Jsonnet rules for Bazel
ron - Rusty Object Notation
kubecfg - A tool for managing complex enterprise Kubernetes environments as code.
SailsJS - Realtime MVC Framework for Node.js
c2bf - Compiler from C to brainfuck
dhall-lang - Maintainable configuration files
jk - Configuration as Code with ECMAScript
io-ts - Runtime type system for IO decoding/encoding