# @optum/json-schema-editor

> JsonSchema Editor React Control

Latest version **2.1.0** (published 2021-06-03) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install @optum/json-schema-editor
pnpm add @optum/json-schema-editor
yarn add @optum/json-schema-editor
bun add @optum/json-schema-editor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2021-06-03 |
| First published | 2020-08-18 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.18.0 <11 \|\| >=12.14.0 <13 \|\| >=13.5.0 |
| Dependencies | 10 |
| Unpacked size | 5.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 66 |
| Maintainers | amyschoen, pkn2054, bwoodrin, seesharpguy |
| Keywords | react |

## Links

- npm: https://www.npmjs.com/package/@optum/json-schema-editor
- Repository: https://github.com/optum/jsonschema-editor-react
- Homepage: https://github.com/optum/jsonschema-editor-react#readme
- Issues: https://github.com/optum/jsonschema-editor-react/issues
- npm.io page: https://npm.io/package/@optum/json-schema-editor

## Dependencies (10)

- [ramda](https://npm.io/package/ramda.md) ^0.27.1
- [typescript](https://npm.io/package/typescript.md) ^3.9.5
- [web-vitals](https://npm.io/package/web-vitals.md) ^0.2.2
- [react-icons](https://npm.io/package/react-icons.md) ^3.0.0
- [use-debounce](https://npm.io/package/use-debounce.md) ^6.0.1
- [framer-motion](https://npm.io/package/framer-motion.md) ^4.0.0
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.0.0
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.0.0
- [@hookstate/core](https://npm.io/package/@hookstate/core.md) ^3.0.7
- [@chakra-ui/react](https://npm.io/package/@chakra-ui/react.md) 1.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2021-06-03
- 2.0.2-alpha3 (alpha) — 2021-06-02
- 2.0.3 — 2021-06-02
- 2.0.2-alpha2 — 2021-06-02
- 2.0.2-alpha — 2021-06-02
- 2.0.1 — 2021-06-01
- 2.0.0 — 2021-06-01
- 1.1.0 — 2021-03-02
- 1.0.3 — 2020-08-20
- 1.0.2 — 2020-08-18

## README

<p align="center">
  json-schema-editor - A React Component
</p>

<p align="center">
  <a href="https://github.com/xojs/xo"><img src="https://img.shields.io/badge/code_style-XO-5ed9c7.svg"></a>➕
  <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>➕
  <a href="https://chakra-ui.com/"><img src="https://img.shields.io/badge/built%20with-chakra--ui-green"></a>➕
<a href="https://optum.github.io/jsonschema-editor-react/"><img src="https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg"></a>
</p>

## Description

> JSON Schema is hypermedia ready, and ideal for annotating your existing JSON-based HTTP API. JSON Schema documents are identified by URIs, which can be used in HTTP Link headers, and inside JSON Schema documents to allow recursive definitions. - [json-schema.org](https://json-schema.org/)

JsonSchemaEditor is a React component library that allows the easy generation of valid `Draft 07` JsonSchema from a UI,  so that it can be easily persisted in a schema management system.

Benefits include:

- Describes your existing data format(s).
- Provides clear human- and machine- readable - documentation.
- Validates data which is useful for:
  - Automated testing.
  - Ensuring quality of client submitted data.

## Documentation

Control documentation and demo can be viewed [here](https://optum.github.io/jsonschema-editor-react/)

## Install

```shell
npm install @optum/json-schema-editor
```

or

```shell
yarn add @optum/json-schema-editor
```

## Props

| property       | type                               | description                                  | default               |
| -------------- | ---------------------------------- | -------------------------------------------- | --------------------- |
| data           | object                             | the initial data for the editor              | {}                    |
| readOnly       | boolean                            | make editor read only                        | false                 |
| onSchemaChange | callback (results: string) => void | callback method to capture changes to schema | required (no default) |

## Usage

```js
import JsonSchemaEditor from "@optum/json-schema-editor";

export const printIt = (schema) => {
  console.log(schema);
};

function App() {
  return (
    <div className="App">
      <JsonSchemaEditor onSchemaChange={printIt} />
    </div>
  );
}

export default App;
```

## License

jsonchema-editor-react is Copyright © 2021 Optum. It is free software and may be redistributed under the Apache 2.0 license.

## Development

### Commands

> Run storybook

```shell
npm run storybook
```

> Create docs and build for release

```shell
npm run build-storybook
```

> Run tests locally

```shell
npm test
```

> Build dist

```shell
npm run build
```

---
_Source: https://npm.io/package/@optum/json-schema-editor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
