Quickly assemble clients for JSON-based APIs (powered by JSON Schema)
Jsonary is a wrapper for JSON data, that deals with JSON Schema. Its goal is to help quickly assemble clients for JSON APIs.
The primary goal of this library is not validation of data, but rather to simplify the fetching, handling and rendering of data. Its focus is correctly assigning JSON Schema to data, which can then be used to select and inform user-interfaces.
The core of Jsonary deals with JSON Schema (including hyper-schema). For example, here we create a Jsonary data wrapper, and apply a schema to it:
The data can be inspected or manipulated, like so:
var title = data.property("title"); alert(title.schemas().minLength()); // 1 ```
More complicated behaviour (such as selecting schemas from
"dependencies", etc) is also handled automatically. Just change the data, and the schemas change with it.
Hyper-schemas can define links on the data, with the URLs parameterised from the data itself:
var authorLink = data.links('author'); alert(authorLink.href); // http://example.com/users/25 ```
Many more properties of links can be inspected
Jsonary comes bundled with a rendering system that bases its interface on the schemas that a data object has applied to it.
More information can be found at: jsonary.com, although this is now slightly out-of-date.
There is also a demo of how the default editable interface deals with various JSON Schema validation keywords here.
Jsonary is released under an MIT License.
The files in the directory
renderers/separate-licensemay have separate licenses. To keep the licensing for Jsonary clean, they are not included in any of the bundles.