Skip to content

Commit 0716f91

Browse files
odeimaizpcrespov
authored andcommitted
Pcrespov fix/project schemas (#20)
- Added -converted makefile genarator to api\specs\shared\schemas\ - fake-user-projects.json deleted - "links" field is not used anymore - removed workbench schema - "key" and "version" are now required - key pattern removed since we also allow keys like: file-picker, multi-plot, which are not registry services - PipelineBody removed from requestedBody in computation/pipeline calls. Project_id is enough * notes and collaborators out from Study * fake-user-projects.json deleted * Added -converted makefile genarator to api\specs\shared\schemas\ * Fixing templates * links fiels is not used anymore * links fiels is not used anymore * synking project and workbench * allow additionalProperties * key and version not included in a group of nodes * Got rid of workbench schema * dash-plot -> multi-plot * simcore/services/dynamic/itis/file-picker -> file-picker * introduced nodes-group key * All services (even groups) have key and version * No Body Requested in /computation/pipeline/ * nodes-group key added to templates * key pattern removed from project schema * "file-picker" added to node.key examples * fixed test_repo_data * file-picker to version 1.0.0 * fixed test_workflow "notes" where removed
1 parent 8468ed7 commit 0716f91

24 files changed

+225
-852
lines changed

api/specs/shared/schemas/Makefile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.PHONY: all build clean help
2+
3+
objects = $(wildcard *.json)
4+
outputs := $(objects:.json=-converted.yaml)
5+
6+
TOOL_IMAGE_NAME := json-schema-to-openapi-schema
7+
8+
9+
# target: all – convert all json-schemas to open-api compatible and formats them in yaml
10+
all: check $(outputs)
11+
12+
%-converted.yaml:%.json
13+
docker run \
14+
-v ${CURDIR}:/input \
15+
-v ${CURDIR}:/output \
16+
$(TOOL_IMAGE_NAME)
17+
18+
# target: check – Checks whether tool is installed
19+
check:
20+
@docker history $(TOOL_IMAGE_NAME) 2>/dev/null \
21+
&& echo "$(TOOL_IMAGE_NAME) is in place" \
22+
|| echo "MISSING $(TOOL_IMAGE_NAME) tool. SEE "scripts/$(TOOL_IMAGE_NAME)" to build it"
23+
24+
# target: clean – Cleans all *-converted.yaml
25+
clean: check
26+
- rm $(outputs)
27+
28+
# target: help – Display all callable targets
29+
help:
30+
@echo
31+
@egrep "^\s*#\s*target\s*:\s*" [Mm]akefile \
32+
| sed -r "s/^\s*#\s*target\s*:\s*//g"
33+
@echo

api/specs/shared/schemas/node-meta-v0.0.1-converted.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ properties:
138138
patternProperties:
139139
.+:
140140
type: string
141-
pattern: '^[_a-z0-9]+$'
141+
pattern: '^[-_a-zA-Z0-9]+$'
142142
example:
143143
- dir/input1.txt: key_1
144144
dir33/input2.txt: key2
@@ -204,6 +204,7 @@ properties:
204204
label: The Rat
205205
- key: dog
206206
label: Bello the Dog
207+
additionalProperties: true
207208
outputs:
208209
type: object
209210
description: definition of the outputs of this node
@@ -255,7 +256,8 @@ properties:
255256
patternProperties:
256257
.+:
257258
type: string
258-
pattern: '^[_a-z0-9]+$'
259+
pattern: '^[-_a-zA-Z0-9]+$'
259260
example:
260261
- dir/input1.txt: key_1
261262
dir33/input2.txt: key2
263+
additionalProperties: true

api/specs/webserver/v0/components/schemas/project-v0.0.1-converted.yaml

+9-32
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ required:
66
- uuid
77
- name
88
- description
9-
- notes
109
- prjOwner
11-
- collaborators
1210
- creationDate
1311
- lastChangeDate
1412
- thumbnail
@@ -30,28 +28,9 @@ properties:
3028
description: longer one-line description about the project
3129
example:
3230
- Dabbling in temporal transitions ...
33-
notes:
34-
type: string
35-
description: longer project description. using common mark
36-
example:
37-
- |-
38-
# title
39-
Some Text `with` common mark markup
4031
prjOwner:
4132
type: string
4233
description: user uuid
43-
collaborators:
44-
type: object
45-
description: UUIDs of the users/groups who should get access to this
46-
x-patternProperties:
47-
^\S+$:
48-
type: array
49-
items:
50-
type: string
51-
enum:
52-
- read
53-
- write
54-
additionalProperties: true
5534
creationDate:
5635
type: string
5736
description: project creation date
@@ -78,18 +57,18 @@ properties:
7857
type: object
7958
additionalProperties: false
8059
required:
60+
- key
61+
- version
8162
- label
8263
- position
8364
properties:
84-
label:
85-
type: string
8665
key:
8766
type: string
8867
description: distinctive name for the node based on the docker registry path
89-
pattern: '^(simcore)/(services)(/demodec)?/(comp|dynamic)(/[^\s/]+)+$'
9068
example:
9169
- simcore/services/comp/sleeper
9270
- simcore/services/dynamic/3dviewer
71+
- file-picker
9372
version:
9473
type: string
9574
description: semantic version number of the node
@@ -98,6 +77,8 @@ properties:
9877
example:
9978
- 1.0.0
10079
- 0.0.1
80+
label:
81+
type: string
10182
progress:
10283
type: number
10384
maximum: 100
@@ -160,6 +141,10 @@ properties:
160141
items:
161142
type: string
162143
pattern: ^\S+$
144+
description: node IDs of where the node is connected to
145+
example:
146+
- nodeUuid1
147+
- nodeUuid2
163148
outputs:
164149
type: object
165150
patternProperties:
@@ -190,14 +175,6 @@ properties:
190175
- string
191176
- 'null'
192177
pattern: ^\S+$
193-
links:
194-
type: array
195-
items:
196-
type: string
197-
description: node IDs of where the node is connected to
198-
example:
199-
- nodeUuid1
200-
- nodeUuid2
201178
position:
202179
type: object
203180
additionalProperties: false

api/specs/webserver/v0/components/schemas/project-v0.0.1.json

+13-42
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"uuid",
1010
"name",
1111
"description",
12-
"notes",
1312
"prjOwner",
14-
"collaborators",
1513
"creationDate",
1614
"lastChangeDate",
1715
"thumbnail",
@@ -40,33 +38,10 @@
4038
"Dabbling in temporal transitions ..."
4139
]
4240
},
43-
"notes": {
44-
"type": "string",
45-
"description": "longer project description. using common mark",
46-
"examples": [
47-
"# title\nSome Text `with` common mark markup"
48-
]
49-
},
5041
"prjOwner": {
5142
"type": "string",
5243
"description": "user uuid"
5344
},
54-
"collaborators": {
55-
"type": "object",
56-
"description": "UUIDs of the users/groups who should get access to this",
57-
"patternProperties": {
58-
"^\\S+$": {
59-
"type": "array",
60-
"items": {
61-
"type": "string",
62-
"enum": [
63-
"read",
64-
"write"
65-
]
66-
}
67-
}
68-
}
69-
},
7045
"creationDate": {
7146
"type": "string",
7247
"description": "project creation date",
@@ -97,20 +72,19 @@
9772
"type": "object",
9873
"additionalProperties": false,
9974
"required": [
75+
"key",
76+
"version",
10077
"label",
10178
"position"
10279
],
10380
"properties": {
104-
"label": {
105-
"type": "string"
106-
},
10781
"key": {
10882
"type": "string",
10983
"description": "distinctive name for the node based on the docker registry path",
110-
"pattern": "^(simcore)/(services)(/demodec)?/(comp|dynamic)(/[^\\s/]+)+$",
11184
"examples": [
11285
"simcore/services/comp/sleeper",
113-
"simcore/services/dynamic/3dviewer"
86+
"simcore/services/dynamic/3dviewer",
87+
"file-picker"
11488
]
11589
},
11690
"version": {
@@ -122,6 +96,9 @@
12296
"0.0.1"
12397
]
12498
},
99+
"label": {
100+
"type": "string"
101+
},
125102
"progress": {
126103
"type":"number",
127104
"maximum": 100,
@@ -205,7 +182,12 @@
205182
"items": {
206183
"type": "string",
207184
"pattern": "^\\S+$"
208-
}
185+
},
186+
"description": "node IDs of where the node is connected to",
187+
"examples": [
188+
"nodeUuid1",
189+
"nodeUuid2"
190+
]
209191
},
210192
"outputs": {
211193
"type": "object",
@@ -248,17 +230,6 @@
248230
"type": ["string", "null"],
249231
"pattern": "^\\S+$"
250232
},
251-
"links": {
252-
"type": "array",
253-
"items": {
254-
"type": "string"
255-
},
256-
"description": "node IDs of where the node is connected to",
257-
"examples": [
258-
"nodeUuid1",
259-
"nodeUuid2"
260-
]
261-
},
262233
"position": {
263234
"type": "object",
264235
"additionalProperties": false,

api/specs/webserver/v0/components/schemas/workbench-converted.yaml

-100
This file was deleted.

0 commit comments

Comments
 (0)