runtypes-to-jsonschema
v1.3.0
Published
convert runtypes schemas to jsonschema
Downloads
2,334
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.