From 56b5619d24b44d23f770b58b0c9e1d4a63b89aca Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 13 Nov 2017 19:32:01 -0500 Subject: Add json-schemas package to mono repo --- packages/json-schemas/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 packages/json-schemas/README.md (limited to 'packages/json-schemas/README.md') 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 +``` -- cgit v1.2.3 From 0cf719a744f5472483dafd0b21afd6b9167168d3 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 14 Nov 2017 22:46:10 -0500 Subject: Add title and install instructions to all sub-package READMEs --- packages/json-schemas/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/json-schemas/README.md') diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md index e9f80e106..d89f57a5e 100644 --- a/packages/json-schemas/README.md +++ b/packages/json-schemas/README.md @@ -1,5 +1,14 @@ +json-schemas +------------ + Contains 0x-related json schemas +## Install: + +```bash +npm install @0xproject/json-schemas --save +``` + ## Usage: ``` import {SchemaValidator, ValidatorResult, schemas} from '@0xproject/json-schemas'; -- cgit v1.2.3