Skip to content

Commit 43092fd

Browse files
committed
feat: add instruction.v1.json json schema of OP
1 parent b7bed5f commit 43092fd

1 file changed

Lines changed: 112 additions & 0 deletions

File tree

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://thumbrise.github.io/op/schema/instruction.v1.json",
4+
"title": "OP",
5+
"description": "Operation Protocol Instruction",
6+
"type": "object",
7+
"properties": {
8+
"version": {
9+
"type": "string"
10+
},
11+
"operations": {
12+
"type": "array",
13+
"items": {
14+
"$ref": "#/$defs/operation"
15+
}
16+
}
17+
},
18+
"required": [
19+
"version",
20+
"operations"
21+
],
22+
"$defs": {
23+
"operation": {
24+
"type": "object",
25+
"properties": {
26+
"id": {
27+
"type": "string",
28+
"description": "Machine-readable operation identifier. For example, full function name."
29+
},
30+
"comment": {
31+
"type": "string",
32+
"description": "Human-readable comment about the operation."
33+
},
34+
"input": {
35+
"$ref": "#/$defs/rail"
36+
},
37+
"output": {
38+
"$ref": "#/$defs/rail"
39+
},
40+
"errors": {
41+
"$ref": "#/$defs/rail"
42+
},
43+
"traits": {
44+
"type": "object",
45+
"additionalProperties": true,
46+
"description": "Ecosystem extensions. For expression problem resolving."
47+
}
48+
},
49+
"required": [
50+
"id",
51+
"comment",
52+
"input",
53+
"output",
54+
"errors"
55+
]
56+
},
57+
"rail": {
58+
"type": "array",
59+
"description": "Machine-readable, semantically grouped set of terms",
60+
"items": {
61+
"$ref": "#/$defs/term"
62+
}
63+
},
64+
"term": {
65+
"type": "object",
66+
"properties": {
67+
"id": {
68+
"type": "string"
69+
},
70+
"value": {
71+
"type": [
72+
"string",
73+
"integer",
74+
"number",
75+
"boolean"
76+
]
77+
},
78+
"kind": {
79+
"type": "string",
80+
"enum": [
81+
"string",
82+
"integer",
83+
"float",
84+
"boolean",
85+
"binary",
86+
"datetime",
87+
"array",
88+
"object",
89+
"enum"
90+
]
91+
},
92+
"of": {
93+
"type": "array",
94+
"items": {
95+
"$ref": "#/$defs/term"
96+
}
97+
}
98+
},
99+
"required": [
100+
"id"
101+
],
102+
"dependentRequired": {
103+
"of": [
104+
"kind"
105+
],
106+
"value": [
107+
"kind"
108+
]
109+
}
110+
}
111+
}
112+
}

0 commit comments

Comments
 (0)