json-schema-view-js

WebJar for json-schema-view-js

License

License

MIT
Categories

Categories

JavaScript Languages JSON Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

json-schema-view-js
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

json-schema-view-js
WebJar for json-schema-view-js
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mohsen1/json-schema-view-js

Download json-schema-view-js

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/json-schema-view-js/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>json-schema-view-js</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/json-schema-view-js/
implementation 'org.webjars.npm:json-schema-view-js:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/json-schema-view-js/
implementation ("org.webjars.npm:json-schema-view-js:1.0.0")
'org.webjars.npm:json-schema-view-js:jar:1.0.0'
<dependency org="org.webjars.npm" name="json-schema-view-js" rev="1.0.0">
  <artifact name="json-schema-view-js" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='json-schema-view-js', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "json-schema-view-js" % "1.0.0"
[org.webjars.npm/json-schema-view-js "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

JSON Schema View (Pure JavaScript)

A pure JavaScript component for rendering JSON Schema in HTML.

JSON Schema is very verbose and hard to read in JSON. This component helps rendering a JSON Schema in a user readable format.

Also available as an AngularJS directive

Usage

Installation

Install via bower

bower install json-schema-view-js --save

Then use global JSONSchemaView constructor

const schema = {type: 'string', title: 'Name'};

const view = new JSONSchemaView(schema);

document.body.appendChild(view.render());

API

JSONSchemaView(schema [, open ] [, options])

schema (Object) - required

The JSON Schema object.

open (Number)

Default: 1 This number indicates up to how many levels the rendered tree should expand. Set it to 0 to make the whole tree collapsed or set it to Infinity to expand the tree deeply

options ('Object')

An object containing other options for construction the view. These are possible options:

theme (string)

A theme defined in the CSS of this view. Possible values: dark. Note that the dark theme is just for making the text brighter so it looks good on dark backgrounds.

Development

Install gulp and run gulp serve to start the server that serves the development version of the project.

Running tests

Once:

npm test

Continues:

gulp test

License

MIT

Versions

Version
1.0.0