diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-20 00:18:43 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-20 00:19:37 +0800 |
commit | 6f2217570f0dd7060cf208da32b18c52c9798871 (patch) | |
tree | 0bd34b345ef58cc6156f700b93b44cd5f32ea420 /packages/website/md/docs/json_schemas/3/usage.md | |
parent | 91ca80b248ac75b0d8258dd4dfc7a6e0c36c572b (diff) | |
parent | 669ea191a5e34ec704851377ee5eedb03c2d1538 (diff) | |
download | dexon-0x-contracts-6f2217570f0dd7060cf208da32b18c52c9798871.tar.gz dexon-0x-contracts-6f2217570f0dd7060cf208da32b18c52c9798871.tar.zst dexon-0x-contracts-6f2217570f0dd7060cf208da32b18c52c9798871.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/discharge
Diffstat (limited to 'packages/website/md/docs/json_schemas/3/usage.md')
-rw-r--r-- | packages/website/md/docs/json_schemas/3/usage.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/website/md/docs/json_schemas/3/usage.md b/packages/website/md/docs/json_schemas/3/usage.md new file mode 100644 index 000000000..2b72eeaad --- /dev/null +++ b/packages/website/md/docs/json_schemas/3/usage.md @@ -0,0 +1,14 @@ +The following example shows you how to validate a 0x order using the `@0x/json-schemas` package. + +```javascript +import {SchemaValidator, ValidatorResult, schemas} from '@0x/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 +``` |