Skills › Scientific Agent Skills › protocolsio-integration › protocol-snapshot.schema.json
protocol-snapshot.schema.json
213 lines · skills/protocolsio-integration/assets/protocol-snapshot.schema.json at 5f2bc03
1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://scientific-agent-skills.local/protocolsio/protocol-snapshot.schema.json",
4 "title": "Local protocols.io protocol snapshot envelope",
5 "description": "A conservative local validation contract for saved protocols.io protocol responses. This is not an official protocols.io schema.",
6 "$defs": {
7 "protocol": {
8 "type": "object",
9 "anyOf": [
10 {
11 "required": [
12 "id"
13 ]
14 },
15 {
16 "required": [
17 "guid"
18 ]
19 },
20 {
21 "required": [
22 "uri"
23 ]
24 },
25 {
26 "required": [
27 "doi"
28 ]
29 },
30 {
31 "required": [
32 "version_uri"
33 ]
34 }
35 ],
36 "properties": {
37 "id": {
38 "type": "integer",
39 "minimum": 0
40 },
41 "guid": {
42 "type": "string",
43 "pattern": "^[A-Fa-f0-9]{32}$"
44 },
45 "uri": {
46 "type": "string",
47 "minLength": 1,
48 "maxLength": 2048
49 },
50 "doi": {
51 "type": [
52 "string",
53 "null"
54 ],
55 "maxLength": 2048
56 },
57 "version_uri": {
58 "type": [
59 "string",
60 "null"
61 ],
62 "maxLength": 2048
63 },
64 "version_id": {
65 "type": [
66 "integer",
67 "null"
68 ],
69 "minimum": 0
70 },
71 "type_id": {
72 "enum": [
73 1,
74 3,
75 4,
76 null
77 ]
78 },
79 "public": {
80 "oneOf": [
81 {
82 "type": "boolean"
83 },
84 {
85 "enum": [
86 0,
87 1,
88 null
89 ]
90 }
91 ]
92 },
93 "title": {
94 "type": [
95 "string",
96 "null"
97 ],
98 "maxLength": 4096
99 },
100 "authors": {
101 "type": [
102 "array",
103 "null"
104 ],
105 "maxItems": 1000,
106 "items": {
107 "type": "object"
108 }
109 },
110 "steps": {
111 "type": [
112 "array",
113 "null"
114 ],
115 "maxItems": 10000,
116 "items": {
117 "type": "object",
118 "properties": {
119 "guid": {
120 "type": "string",
121 "pattern": "^[A-Fa-f0-9]{32}$"
122 },
123 "previous_guid": {
124 "type": [
125 "string",
126 "null"
127 ],
128 "pattern": "^[A-Fa-f0-9]{32}$"
129 }
130 },
131 "additionalProperties": true
132 }
133 },
134 "materials": {
135 "type": [
136 "array",
137 "null"
138 ],
139 "maxItems": 10000
140 },
141 "versions": {
142 "type": [
143 "array",
144 "null"
145 ],
146 "maxItems": 1000,
147 "items": {
148 "type": "object"
149 }
150 }
151 },
152 "additionalProperties": true
153 }
154 },
155 "anyOf": [
156 {
157 "type": "object",
158 "required": [
159 "protocol"
160 ],
161 "properties": {
162 "status_code": {
163 "enum": [
164 0,
165 "0",
166 null
167 ]
168 },
169 "protocol": {
170 "$ref": "#/$defs/protocol"
171 }
172 },
173 "additionalProperties": true
174 },
175 {
176 "type": "object",
177 "required": [
178 "payload"
179 ],
180 "properties": {
181 "status_code": {
182 "enum": [
183 0,
184 "0",
185 null
186 ]
187 },
188 "payload": {
189 "anyOf": [
190 {
191 "$ref": "#/$defs/protocol"
192 },
193 {
194 "type": "object",
195 "required": [
196 "protocol"
197 ],
198 "properties": {
199 "protocol": {
200 "$ref": "#/$defs/protocol"
201 }
202 }
203 }
204 ]
205 }
206 },
207 "additionalProperties": true
208 },
209 {
210 "$ref": "#/$defs/protocol"
211 }
212 ]
213}