Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Convert Yup Schema to Json-Schema

License

Notifications You must be signed in to change notification settings

mr-yum/yup-to-json-schema

 
 

Repository files navigation

yup-to-json-schema

Yup is a library to validate the JSON input

JSON-Schema is a schema specification for JSON

This library converts Yup schema to JSON-Schema

Installation

npm i @sodaru/yup-to-json-schema

Usage

import yupToJsonSchema from "@sodaru/yup-to-json-schema"

// see Yup Specification for more options to create yupSchema
const yupSchema = object({
    name: string()
}).required();

const jsonSchema = yupToJsonSchema(yupSchema);

About

Convert Yup Schema to Json-Schema

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.0%
  • JavaScript 3.0%