0.0.10 • Published 2 years ago

@lowcode-modou/json-schema-to-zod v0.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Json-Schema-to-Zod

NPM Version

Summary

A very simple CLI tool to convert JSON schema (draft 4+) objects or files into Zod schemas. Uses Prettier for formatting for now.

Usage

Online

Paste your schemas here

CLI

json-schema-to-zod -s myJson.json -t mySchema.ts

Options:

Programmatic

import { jsonSchemaToZod } from "json-schema-to-zod";

const myObject = {
  type: "object",
  properties: {
    hello: {
      type: "string",
    },
  },
};

const result = jsonSchemaToZod(myObject);

console.log(result);

Expected output:

const schema = z.object({hello: z.string()});
0.0.10

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago