diff options
Diffstat (limited to 'packages/json-schemas/README.md')
-rw-r--r-- | packages/json-schemas/README.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md new file mode 100644 index 000000000..e9f80e106 --- /dev/null +++ b/packages/json-schemas/README.md @@ -0,0 +1,15 @@ +Contains 0x-related json schemas + +## Usage: +``` +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 +``` |