项目作者: stoplightio

项目描述 :
A JSON Schema viewer React component
高级语言: TypeScript
项目地址: git://github.com/stoplightio/json-schema-viewer.git
创建时间: 2018-12-26T20:03:18Z
项目社区:https://github.com/stoplightio/json-schema-viewer

开源协议:Apache License 2.0

下载


@stoplight/json-schema-viewer

A JSON Schema viewer React component

Features

  • Full JSON Schema Draft 4 support, including oneOf and anyOf combiner properties
  • Renders complicated nested objects to any depth
  • Renders validation properties and markdown descriptions
  • Capable of linking resolved \$refs
  • Theme-able
  • Collapsible

Installation

Supported in modern browsers and node.

  1. # latest stable
  2. yarn add @stoplight/json-schema-viewer

Usage

  1. // index.jsx
  2. import { JsonSchemaViewer } from "@stoplight/json-schema-viewer";
  3. <JsonSchemaViewer
  4. name="Todos Model"
  5. schema={schema}
  6. expanded={true}
  7. hideTopBar={false}
  8. emptyText="No schema defined"
  9. defaultExpandedDepth={0}
  10. ></JsonSchemaViewer>;

More examples can be find in the Storybook stories.

Contributing

  1. Clone repo.
  2. Create / checkout feature/{name}, chore/{name}, or fix/{name} branch.
  3. Install deps: yarn.
  4. Make your changes.
  5. Run tests: yarn test.prod.
  6. Stage relevant files to git.
  7. Commit: yarn commit. NOTE: Commits that don’t follow the conventional format will be rejected. yarn commit creates this format for you, or you can put it together manually and then do a regular git commit.
  8. Push: git push.
  9. Open PR targeting the develop branch.