1.3.0 • Published 11 months ago

runtypes-to-jsonschema v1.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

runtypes-to-jsonschema

convert runtypes schemas to jsonschema.

main

install

npm install runtypes-to-jsonschema

usage

import { tojsonschema } from "runtypes-to-jsonschema";
import * as rt from "runtypes";

const myRtSchema = rt.Record({ foo: rt.Literal("bar") });
const myjsonschema = tojsonschema(myRtSchema);
// { type: "object", properties: { foo: { const: "bar" } } }

see test.ts for more.