Skip to main content

farrow-json-schema

Tool for Transforming farrow-schema to json schema.

Installation

yarn add farrow-json-schema

Usage

import { Int, Type } from 'farrow-schema'

const definition = {
[Type]: Int,
}

const jsonSchema = transform(definition)
/**
{
$id: '/farrow/schema',
$ref: '#/definitions/0',
definitions: {
0: {
$id: '0',
type: 'integer',
},
},
}
** /

Api

Type Signature:

const transform: (input: FieldDescriptor) => JSONSchema7;

Learn more

Relative Module