runtypes-to-jsonschema
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

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.

Package Sidebar

Install

npm i runtypes-to-jsonschema

Weekly Downloads

3

Version

1.3.0

License

ISC

Unpacked Size

6.74 kB

Total Files

4

Last publish

Collaborators

  • cdaringe
  • wa11-e