Skip to content

Commit 678d1e4

Browse files
authored
Merge pull request json-schema-org#134 from adamvoss/draft-6
Update website examples for Draft 6
2 parents 2101e78 + fa5975f commit 678d1e4

29 files changed

+493
-458
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Jekyll products
22
.sass-cache/
33
_site/
4+
node_modules/

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
language: ruby
22
dist: trusty
33
sudo: false
4+
node_js:
5+
- node
6+
before_script:
7+
- npm install ajv-cli
8+
- PATH="./node_modules/.bin/:$PATH"
49
script:
510
- bundle exec jekyll build
11+
- ajv test -s schema -d "_includes/person.json" --valid
12+
- ajv test -s schema -d "_includes/example1/schema*.json" --valid
13+
- ajv test -s _includes/example1/schema1.json -d _includes/example1/instance.json --valid
14+
- ajv test -s _includes/example1/schema2.json -d _includes/example1/instance.json --valid
15+
- ajv test -s _includes/example1/schema3.json -d _includes/example1/instance.json --valid
16+
- ajv test -s _includes/example1/schema4.json -d _includes/example1/instance.json --valid
17+
- ajv test -s _includes/example1/schema5.json -d _includes/example1/instance.json --valid
18+
- ajv test -s schema -d _includes/example1/set_schema.json --valid
19+
- ajv test -s _includes/example1/set_schema.json -d _includes/example1/set_instance.json -r geo --valid
20+
- ajv test -s schema -d "_includes/example2/schema*.json" --valid
21+
- ajv test -s schema -d "_includes/example2/entry_schema*.json" --valid
22+
- ajv test -s schema -d "_includes/example2/storage_schema*.json" --valid
23+
- ajv test -s _includes/example2/schema1.json -d _includes/example2/instance.json --valid
24+
- ajv test -s _includes/example2/schema2.json -d _includes/example2/instance.json -r _includes/example2/entry_schema3.json --valid
25+
- ajv test -s schema -d address -d calendar -d card -d geo --valid

_config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ header_pages:
3131
- examples.md
3232
- implementations.md
3333

34-
collections:
35-
docs:
36-
output: true
37-
permalink: "/:title:output_ext"
34+
exclude:
35+
- README.md
36+
- Gemfile
37+
- node_modules
3838

3939
gems:
4040
- jekyll-relative-links

_includes/example1/instance.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": 1,
3+
"name": "A green door",
4+
"price": 12.50,
5+
"tags": ["home", "green"]
6+
}

_includes/example1/schema1.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"title": "Product",
4+
"description": "A product from Acme's catalog",
5+
"type": "object"
6+
}

_includes/example1/schema2.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"title": "Product",
4+
"description": "A product from Acme's catalog",
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"description": "The unique identifier for a product",
9+
"type": "integer"
10+
}
11+
},
12+
"required": ["id"]
13+
}

_includes/example1/schema3.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"title": "Product",
4+
"description": "A product from Acme's catalog",
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"description": "The unique identifier for a product",
9+
"type": "integer"
10+
},
11+
"name": {
12+
"description": "Name of the product",
13+
"type": "string"
14+
}
15+
},
16+
"required": ["id", "name"]
17+
}

_includes/example1/schema4.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"title": "Product",
4+
"description": "A product from Acme's catalog",
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"description": "The unique identifier for a product",
9+
"type": "integer"
10+
},
11+
"name": {
12+
"description": "Name of the product",
13+
"type": "string"
14+
},
15+
"price": {
16+
"type": "number",
17+
"exclusiveMinimum": 0
18+
}
19+
},
20+
"required": ["id", "name", "price"]
21+
}

_includes/example1/schema5.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"title": "Product",
4+
"description": "A product from Acme's catalog",
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"description": "The unique identifier for a product",
9+
"type": "integer"
10+
},
11+
"name": {
12+
"description": "Name of the product",
13+
"type": "string"
14+
},
15+
"price": {
16+
"type": "number",
17+
"exclusiveMinimum": 0
18+
},
19+
"tags": {
20+
"type": "array",
21+
"items": {
22+
"type": "string"
23+
},
24+
"minItems": 1,
25+
"uniqueItems": true
26+
}
27+
},
28+
"required": ["id", "name", "price"]
29+
}

_includes/example1/set_instance.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[
2+
{
3+
"id": 2,
4+
"name": "An ice sculpture",
5+
"price": 12.50,
6+
"tags": ["cold", "ice"],
7+
"dimensions": {
8+
"length": 7.0,
9+
"width": 12.0,
10+
"height": 9.5
11+
},
12+
"warehouseLocation": {
13+
"latitude": -78.75,
14+
"longitude": 20.4
15+
}
16+
},
17+
{
18+
"id": 3,
19+
"name": "A blue mouse",
20+
"price": 25.50,
21+
"dimensions": {
22+
"length": 3.1,
23+
"width": 1.0,
24+
"height": 1.0
25+
},
26+
"warehouseLocation": {
27+
"latitude": 54.4,
28+
"longitude": -32.7
29+
}
30+
}
31+
]

0 commit comments

Comments
 (0)