json-viewer

WebJar for json-viewer

License

License

Categories

Categories

CLI User Interface JSON Data
GroupId

GroupId

org.webjars.bowergithub.advanced-rest-client
ArtifactId

ArtifactId

json-viewer
Last Version

Last Version

2.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

json-viewer
WebJar for json-viewer
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/advanced-rest-client/json-viewer

Download json-viewer

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/json-viewer/ -->
<dependency>
    <groupId>org.webjars.bowergithub.advanced-rest-client</groupId>
    <artifactId>json-viewer</artifactId>
    <version>2.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/json-viewer/
implementation 'org.webjars.bowergithub.advanced-rest-client:json-viewer:2.0.2'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/json-viewer/
implementation ("org.webjars.bowergithub.advanced-rest-client:json-viewer:2.0.2")
'org.webjars.bowergithub.advanced-rest-client:json-viewer:jar:2.0.2'
<dependency org="org.webjars.bowergithub.advanced-rest-client" name="json-viewer" rev="2.0.2">
  <artifact name="json-viewer" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.advanced-rest-client', module='json-viewer', version='2.0.2')
)
libraryDependencies += "org.webjars.bowergithub.advanced-rest-client" % "json-viewer" % "2.0.2"
[org.webjars.bowergithub.advanced-rest-client/json-viewer "2.0.2"]

Dependencies

compile (5)

Group / Artifact Type Version
org.webjars.bowergithub.polymerelements : iron-flex-layout jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : iron-collapse jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : iron-test-helpers jar [2.0.0,3)
org.webjars.bowergithub.polymer : polymer jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-spinner jar [2.1.0,3)

Project Modules

There are no modules declared in this project.

Deprecation notice

This component is deprecated. Use @advanced-rest-client/arc-response instead.

Published on NPM

Build Status

Published on webcomponents.org

<json-viewer>

ARC JSON payload (HTTP response) viewer.

<json-viewer json="..."></json-viewer>

API components

This components is a part of API components ecosystem

Usage

Installation

npm install --save @advanced-rest-client/json-viewer

In an html file

<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/json-viewer/json-viewer.js';
    </script>
  </head>
  <body>
    <json-viewer json="..."></json-viewer>
  </body>
</html>

In a LitElement

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/json-viewer/json-viewer.js';

class SampleElement extends PolymerElement {
  render() {
    return html`
    <json-viewer .json="${this.json}"></json-viewer>
    `;
  }
}
customElements.define('sample-element', SampleElement);

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@advanced-rest-client/json-viewer/json-viewer.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
    <json-viewer json="[[json]]"></json-viewer>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Big numbers in JavaScript

This element marks all numbers that are above Number.MAX_SAFE_INTEGER value and locates the numeric value in source json if passed json was a string or when raw attribute was set. In this case it will display a warning and explanation about use of big numbers in JavaScript. See js-max-number-error element documentation for more information.

Content actions

The element can render a actions pane above the code view. Action pane is to display content actions that is relevan in context of the response displayed below the icon buttons. It should be icon buttons or just buttons added to this view.

Buttons needs to have content-action property set to be included to this view.

<json-viewer json='{"json": "test"}'>
  <paper-icon-button content-action title="Copy content to clipboard" icon="arc:content-copy"></paper-icon-button>
</json-viewer>

Installation

git clone https://github.com/advanced-rest-client/json-viewer
cd json-viewer
npm install

Running the demo locally

npm start

Running the tests

npm test
org.webjars.bowergithub.advanced-rest-client

ARC

A set of repositories related to the Advanced REST Client and API console (by Mulesoft)

Versions

Version
2.0.2