Commit f75b6acf authored by Jaap Karan Singh's avatar Jaap Karan Singh

Minor doc updates

parent 487a61ba
{
"name": "jsonschema-extra",
"version": "1.1.0",
"description": "Extends jsonschema with custom types and attributes",
"version": "1.1.1",
"description": "Extends jsonschema validator with some common custom types and attributes",
"main": "index.js",
"directories": {
"test": "test"
......
jsonschema EXTRAAA!!! [![NPM version][npm-image]][npm-url]
=====================
# jsonschema-extra
[![NPM version][npm-image]][npm-url]
[![David deps][david-image]][david-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/jsonschema-extra.svg?style=flat-square
[npm-url]: https://npmjs.org/package/jsonschema-extra
[travis-image]: https://img.shields.io/travis/jksdua/jsonschema-extra.svg?style=flat-square
[travis-url]: https://travis-ci.org/jksdua/jsonschema-extra
[coveralls-image]: https://img.shields.io/coveralls/jksdua/jsonschema-extra.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/jksdua/jsonschema-extra?branch=master
[david-image]: https://img.shields.io/david/jksdua/jsonschema-extra.svg?style=flat-square
[david-url]: https://david-dm.org/jksdua/jsonschema-extra
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/jsonschema-extra.svg?style=flat-square
[download-url]: https://npmjs.org/package/jsonschema-extra
**Extends jsonschema validator with some common custom types and attributes**
Usage
-----
## Usage
### Installation
......@@ -17,10 +33,10 @@ npm install jsonschema-extra --save
```js
var jsonschema = require('jsonschema');
var extend = require('jsonschema-extra');
var extra = require('jsonschema-extra');
var validator = new (jsonschema.Validator)();
extend(validator);
extra(validator);
// regexp
validator.validate(/abc/, { type: 'regexp' });
......@@ -33,13 +49,11 @@ validator.validate('123456789012345678901234', { type: 'objectId' });
```
### Details
#### Attributes
## Attributes
See `jsonschema` documentation for more detailed documentation on custom attributes.
##### validate
### validate
Custom validator when `jsonschema` just isn't what you are after. This one is my absolute favourite! It comes in handy whenever you are trying to do something complex.
......@@ -77,7 +91,7 @@ var schema = {
```
#### Types
## Types
Supported types:
......@@ -104,8 +118,7 @@ validator.validate({ a: 'a', b: 'b' }, { type: 'plainObject' });
```
Testing
-------
## Testing
Install `mocha` globally
......@@ -120,8 +133,10 @@ $ npm test
```
Changelog
---------
## Changelog
### v1.1.1 (19 Sep 2014)
- Minor doc updates
### v1.1.0 (18 Sep 2014)
- Allow multiple validators in the `validate` property
......@@ -139,7 +154,3 @@ Changelog
- Name of module changed to jsonschema-extra
- Removed conditionalEnum custom attribute since this has been fixed in the latest versions of jsonschema
- Removed `speed` type
[npm-image]: https://img.shields.io/npm/v/jsonschema-extra.svg?style=flat-square
[npm-url]: https://npmjs.org/package/jsonschema-extra
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment