blob: 2b72eeaad30588ac23b1860768c856acd19ba884 (
plain) (
tree)
|
|
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
```
|