convert runtypes schemas to jsonschema
npm install runtypes-pretty-validationvalidate runtypes schemas against a value, and reflect back a pretty validation report, matching the schema.
Prettyifies structural error messages arbitrarily deep.
``tsbar
import { validate } from "runtypes-pretty-validation";
const schema = rt.Record({ foo: rt.Literal("bar") });
validate(schema, null); // Expected object, got "null"
validate(schema, { bar: "bar" }); // { foo: 'Expected literal , but was undefined' }`
validate(schema, { foo: "bar" }); // undefined, all valid

npm install runtypes-pretty-validation
Options may be specified. See ./index.ts for defaults.
`ts`
validate(schema, value[, opts])
- useFirstUnionSchemaOnFail: boolean`: if a validation fails all union members, report the schema validation errors from the first schema in the union.
see test.ts for more.