diff options
author | Kadinsky <kandinsky454@protonmail.ch> | 2018-10-19 04:15:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 04:15:31 +0800 |
commit | 65d85ca5008fe0c307506b388d6ace858122f8ad (patch) | |
tree | f8d4b0aa654eab3f26bdbfe40dea6fb7e105e864 /packages/website/md/docs/json_schemas | |
parent | 857eb95ac0f8299fe517321cb805a836232222bc (diff) | |
parent | c2038eae5bc02fc24edcb369381b0d9699aed0aa (diff) | |
download | dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.tar dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.tar.gz dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.tar.bz2 dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.tar.lz dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.tar.xz dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.tar.zst dexon-sol-tools-65d85ca5008fe0c307506b388d6ace858122f8ad.zip |
Merge pull request #1158 from 0xProject/docSectionFixes
Update Doc Ref Markdown Sections
Diffstat (limited to 'packages/website/md/docs/json_schemas')
-rw-r--r-- | packages/website/md/docs/json_schemas/1/installation.md (renamed from packages/website/md/docs/json_schemas/1.0.0/installation.md) | 0 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/1/introduction.md (renamed from packages/website/md/docs/json_schemas/1.0.0/introduction.md) | 0 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/1/schemas.md (renamed from packages/website/md/docs/json_schemas/1.0.0/schemas.md) | 0 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/1/usage.md (renamed from packages/website/md/docs/json_schemas/1.0.0/usage.md) | 0 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/2/schemas.md (renamed from packages/website/md/docs/json_schemas/2.0.0/schemas.md) | 0 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/3/installation.md | 17 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/3/introduction.md | 3 | ||||
-rw-r--r-- | packages/website/md/docs/json_schemas/3/usage.md | 14 |
8 files changed, 34 insertions, 0 deletions
diff --git a/packages/website/md/docs/json_schemas/1.0.0/installation.md b/packages/website/md/docs/json_schemas/1/installation.md index 50a37bae1..50a37bae1 100644 --- a/packages/website/md/docs/json_schemas/1.0.0/installation.md +++ b/packages/website/md/docs/json_schemas/1/installation.md diff --git a/packages/website/md/docs/json_schemas/1.0.0/introduction.md b/packages/website/md/docs/json_schemas/1/introduction.md index 5b2e90387..5b2e90387 100644 --- a/packages/website/md/docs/json_schemas/1.0.0/introduction.md +++ b/packages/website/md/docs/json_schemas/1/introduction.md diff --git a/packages/website/md/docs/json_schemas/1.0.0/schemas.md b/packages/website/md/docs/json_schemas/1/schemas.md index fcf5d8df6..fcf5d8df6 100644 --- a/packages/website/md/docs/json_schemas/1.0.0/schemas.md +++ b/packages/website/md/docs/json_schemas/1/schemas.md diff --git a/packages/website/md/docs/json_schemas/1.0.0/usage.md b/packages/website/md/docs/json_schemas/1/usage.md index 68b801153..68b801153 100644 --- a/packages/website/md/docs/json_schemas/1.0.0/usage.md +++ b/packages/website/md/docs/json_schemas/1/usage.md diff --git a/packages/website/md/docs/json_schemas/2.0.0/schemas.md b/packages/website/md/docs/json_schemas/2/schemas.md index ec7cf6f15..ec7cf6f15 100644 --- a/packages/website/md/docs/json_schemas/2.0.0/schemas.md +++ b/packages/website/md/docs/json_schemas/2/schemas.md diff --git a/packages/website/md/docs/json_schemas/3/installation.md b/packages/website/md/docs/json_schemas/3/installation.md new file mode 100644 index 000000000..a99886113 --- /dev/null +++ b/packages/website/md/docs/json_schemas/3/installation.md @@ -0,0 +1,17 @@ +**Install** + +```bash +yarn add @0x/json-schemas +``` + +**Import** + +```javascript +import { schemas } from '@0x/json-schemas'; +``` + +or + +```javascript +var schemas = require('@0x/json-schemas').schemas; +``` diff --git a/packages/website/md/docs/json_schemas/3/introduction.md b/packages/website/md/docs/json_schemas/3/introduction.md new file mode 100644 index 000000000..0039d014a --- /dev/null +++ b/packages/website/md/docs/json_schemas/3/introduction.md @@ -0,0 +1,3 @@ +Welcome to the [json-schemas](https://github.com/0xProject/0x-monorepo/tree/development/packages/json-schemas) documentation! This package provides JSON schemas for validating 0x Protocol & Standard Relayer API data structures. It provides both the raw JSON schemas and a schema validator class to interact with them from a JS project. + +If you are not using a Javascript-based language for your project, you can use a Javascript environment to render the JSON schemas within this package and use them together with a [JSON Schema](http://json-schema.org/) implementation in your [language of choice](http://json-schema.org/implementations.html) (e.g Python, Haskell, Go, C, C++, Rust, Ruby, Scala, etc...). 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 +``` |