runtypes-to-jsonschema
v1.3.0
Published
convert runtypes schemas to jsonschema
Downloads
1,946
Readme
runtypes-to-jsonschema
convert runtypes schemas to jsonschema.
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.