json-schema-to-proptypes

0.1.0 • Public • Published

json-schema-to-proptypes

Transform JSON Schema schemas to PropTypes.

This package was imported from and is a subset of https://github.com/dowjones/react-json-schema-proptypes. Doesn't depend on React nor on PropTypes packages.

Supports JSON Schema draft-04 schemas conversion to a custom PropType function that will validate against that schema.

Usage

import jsonSchemaToPropTypes from './'
 
const mySchema = {
  type: 'object',
  required: ['a'],
  properties: {
    a: { type: 'string' },
    b: { type: 'string' }
  }
}
 
const myPropTypes = jsonSchemaToPropTypes(mySchema)

Dependents (0)

Package Sidebar

Install

npm i json-schema-to-proptypes

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

224 kB

Total Files

11

Last publish

Collaborators

  • rafaeleyng