0.2.1 • Published 8 years ago

ember-json-schema-document v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

ember-json-schema-document

The purpose of this addon is to simplify the process of creating and validating schema-based JSON documents.

Building an array-based Document

var schema = new Schema(jsonBlob);
var document = schema.buildDocument();

item = document.addItem();
item.set('description', 'Headquarters');
item.set('streetAddress', '155 Water St');

document.dump();

[{
  "description": "Headquarters",
  "streetAddress": "155 Water St"
}]

Building an object-based Document

var schema = new Schema(jsonBlob);
var document = schema.buildDocument();

document.set('description', 'Headquarters');
document.set('streetAddress', '155 Water St');

document.dump();

{
  "description": "Headquarters",
  "streetAddress": "155 Water St"
}

Loading a schema by URL

var url = 'https://gridiron.aptible.com/schemas/workforce_locations/v0.0.3';

Schema.load(url).then((schema) => {
  var document = schema.buildDocument();
  var location = document.addItem();

  location.set('address', '155 Water St');
});

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

0.2.1

8 years ago

0.2.0

8 years ago

0.1.6

9 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago