diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-10 01:05:38 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-10 01:05:38 +0800 |
commit | 324b1079e7eb29829bf06ff65299acdc58abf308 (patch) | |
tree | b03cc6abb6cf5595bef75609a82664855db1ad7a /packages/website/md/docs/json_schemas/1.0.0/usage.md | |
parent | a9b320e636850693edd535da20ce7e5ec949926e (diff) | |
download | dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.tar dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.tar.gz dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.tar.bz2 dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.tar.lz dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.tar.xz dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.tar.zst dexon-0x-contracts-324b1079e7eb29829bf06ff65299acdc58abf308.zip |
Add ability to nest doc ref markdown under specific versions
Diffstat (limited to 'packages/website/md/docs/json_schemas/1.0.0/usage.md')
-rw-r--r-- | packages/website/md/docs/json_schemas/1.0.0/usage.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/website/md/docs/json_schemas/1.0.0/usage.md b/packages/website/md/docs/json_schemas/1.0.0/usage.md new file mode 100644 index 000000000..68b801153 --- /dev/null +++ b/packages/website/md/docs/json_schemas/1.0.0/usage.md @@ -0,0 +1,14 @@ +The following example shows you how to validate a 0x order using the `@0xproject/json-schemas` package. + +```javascript +import {SchemaValidator, ValidatorResult, schemas} from '@0xproject/json-schemas'; + +const {orderSchema} = schemas; +const validator = new SchemaValidator(); + +const order = { + ... +}; +const validatorResult: ValidatorResult = validator.validate(order, orderSchema); // Contains all errors +const isValid: boolean = validator.isValid(order, orderSchema); // Only returns boolean +``` |