Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
vacekj committed Oct 15, 2017
1 parent 088d19e commit fb35d63
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
[![npm](https://img.shields.io/npm/v/express-json-validator-middleware.svg)](https://www.npmjs.com/package/express-json-validator-middleware)
[![npm](https://img.shields.io/npm/l/express-json-validator-middleware.svg)](https://www.npmjs.com/package/express-json-validator-middleware)

Coming from `express-jsonschema`? Read our [migration notes](#migrating)

Based heavily on https://github.com/trainiac/express-jsonschema. A big thank you to @trainiac for the original package!

## Why use this library over [express-jsonschema](https://github.com/trainiac/express-jsonschema) ?
Expand Down Expand Up @@ -190,9 +192,9 @@ npm test

- [spacetelescope's understanding json schema](http://spacetelescope.github.io/understanding-json-schema/)

## Notes
## <a name="migrating"></a> Migrating from `express-jsonschema`

In ```express-jsonschema```, you could define a required property in two ways. Ajv only supports one way of doing this.
In `express-jsonschema`, you could define a required property in two ways. Ajv only supports one way of doing this.

```js

Expand All @@ -203,7 +205,7 @@ In ```express-jsonschema```, you could define a required property in two ways. A
foo: {
type: 'string'
},
required: ['foo']
required: ['foo'] <--
}
}

Expand All @@ -213,7 +215,7 @@ In ```express-jsonschema```, you could define a required property in two ways. A
properties: {
foo: {
type: 'string',
required: true
required: true
}
}
}
Expand Down

0 comments on commit fb35d63

Please sign in to comment.