Skip to content

Commit a93d9e3

Browse files
authored
Merge pull request #1 from AssetFetch/add-json-schema
Add json schema
2 parents 4afee75 + 6eff01a commit a93d9e3

28 files changed

+986
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@ There are still numerous milestones to hit before a version 1.0 can be released.
2424

2525
- ...
2626

27+
# JSON Schema
28+
29+
JSON-Schemas for AssetFetch are provided in the `/json-schema` subdirectory of this repository.
30+
2731
# Contributing
2832
Currently the best way to contribute is by opening issues with questions, contradictions in the specifications, suggestions for datablocks or any other thoughts about the specification.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Asset List Query Datablock",
4+
"$id": "/datablock/asset_list_query.json",
5+
"$comment": "This datablock is just a variable query with no other fields.",
6+
"$ref": "/template/variable_query.json"
7+
}

json-schema/datablock/authors.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Authors Datablock",
4+
"$id": "/datablock/authors.json",
5+
"$comment": "This datablock contains information about the authors of a provider or an individual asset.",
6+
"type":"array",
7+
"items": {
8+
"type":"object",
9+
"properties": {
10+
"name":{
11+
"type":"string"
12+
},
13+
"uri":{
14+
"type":"string",
15+
"format": "uri"
16+
},
17+
"role":{
18+
"type":"string"
19+
}
20+
},
21+
"required": ["name"]
22+
}
23+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Behavior Datablock",
4+
"$id": "/datablock/behavior.json",
5+
"$comment": "This datablock contains information about how the client should treat a component.",
6+
"type": "object",
7+
"properties": {
8+
"style": {
9+
"type": "string",
10+
"enum": [
11+
"active",
12+
"passive"
13+
]
14+
}
15+
},
16+
"required": [
17+
"style"
18+
]
19+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Branding Datablock",
4+
"$id": "/datablock/branding.json",
5+
"$comment": "This datablock contains branding information about a provider.",
6+
"type": "object",
7+
"properties": {
8+
"color_accent": {
9+
"type": "string",
10+
"pattern": "[0-9a-f]{6}"
11+
},
12+
"logo_square_uri": {
13+
"type": "string",
14+
"format":"uri"
15+
},
16+
"logo_wide_uri":{
17+
"type":"string",
18+
"format":"uri"
19+
},
20+
"banner_uri":{
21+
"type":"string",
22+
"format":"uri"
23+
}
24+
},
25+
"required": []
26+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Dimensions (2D) Datablock",
4+
"$id": "/datablock/dimensions.2d.json",
5+
"$comment": "This datablock describes physical dimensions for 2D assets.",
6+
"type": "object",
7+
"properties": {
8+
"width_m": {
9+
"type": "number"
10+
},
11+
"height_m": {
12+
"type": "number"
13+
}
14+
},
15+
"required": []
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Dimensions (3D) Datablock",
4+
"$id": "/datablock/dimensions.3d.json",
5+
"$comment": "This datablock describes physical dimensions for 3D assets.",
6+
"type": "object",
7+
"properties": {
8+
"width_m": {
9+
"type": "number"
10+
},
11+
"height_m": {
12+
"type": "number"
13+
},
14+
"depth_m":{
15+
"type":"number"
16+
}
17+
},
18+
"required": []
19+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": ".blend File Datablock",
4+
"$id": "/datablock/format.blend.json",
5+
"$comment": "This datablock describes details about a .blend file for Blender.",
6+
"type": "object",
7+
"properties": {
8+
"version": {
9+
"type":"string",
10+
"pattern": "^[0-9]+(\\.[0-9]+)(\\.[0-9]+)[a-z]?$"
11+
},
12+
"is_asset":{
13+
"type":"boolean"
14+
},
15+
"targets": {
16+
"type": "array",
17+
"items": {
18+
"type": "object",
19+
"required": ["kind","names"],
20+
"properties": {
21+
"kind": {
22+
"type": "string",
23+
"enum": [
24+
"actions",
25+
"armatures",
26+
"brushes",
27+
"cache_files",
28+
"cameras",
29+
"collections",
30+
"curves",
31+
"fonts",
32+
"grease_pencils",
33+
"hair_curves",
34+
"images",
35+
"lattices",
36+
"lightprobes",
37+
"lights",
38+
"linestyles",
39+
"masks",
40+
"materials",
41+
"meshes",
42+
"metaballs",
43+
"movieclips",
44+
"node_groups",
45+
"objects",
46+
"paint_curves",
47+
"palettes",
48+
"particles",
49+
"pointclouds",
50+
"scenes",
51+
"screens",
52+
"simulations",
53+
"sounds",
54+
"speakers",
55+
"texts",
56+
"textures",
57+
"volumes",
58+
"workspaces",
59+
"worlds"
60+
]
61+
},
62+
"names": {
63+
"type": "array",
64+
"items": {
65+
"type":"string"
66+
}
67+
}
68+
}
69+
}
70+
}
71+
},
72+
"required": []
73+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": ".obj File Datablock",
4+
"$id": "/datablock/format.obj.json",
5+
"type": "object",
6+
"properties": {
7+
"up_axis": {
8+
"type": "string",
9+
"enum": [
10+
"+y",
11+
"+z"
12+
]
13+
},
14+
"use_mtl": {
15+
"type": "boolean"
16+
}
17+
},
18+
"required": []
19+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": ".usd File Datablock",
4+
"$id": "/datablock/format.usd.json",
5+
"type": "object",
6+
"properties": {
7+
"is_crate":{
8+
"type":"boolean"
9+
}
10+
},
11+
"required": []
12+
}

0 commit comments

Comments
 (0)