Skip to content

Commit 5d21604

Browse files
authored
bugfix: correct project jsonschema regarding runHash field (#2111)
* runHash can be null * correctly output runHash nullability
1 parent 16b1153 commit 5d21604

File tree

8 files changed

+77
-19
lines changed

8 files changed

+77
-19
lines changed

api/specs/common/schemas/project-v0.0.1-converted.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ properties:
123123
description: >-
124124
the hex digest of the resolved inputs +outputs hash at the time
125125
when the last outputs were generated
126-
type: string
126+
type:
127+
- string
128+
- 'null'
127129
example:
128130
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
129131
inputs:

api/specs/common/schemas/project-v0.0.1.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@
157157
},
158158
"runHash": {
159159
"description": "the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated",
160-
"type": "string",
160+
"type": [
161+
"string",
162+
"null"
163+
],
161164
"examples": [
162165
"a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2"
163166
]

packages/models-library/src/models_library/projects_nodes.py

+9
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,12 @@ def convert_old_enum_name(cls, v):
148148

149149
class Config:
150150
extra = Extra.forbid
151+
152+
# NOTE: exporting without this trick does not make runHash as nullabel.
153+
# It is a Pydantic issue see https://github.com/samuelcolvin/pydantic/issues/1270
154+
@staticmethod
155+
def schema_extra(schema, _):
156+
for prop, value in schema.get("properties", {}).items():
157+
if prop in ["runHash"]: # Your actual nullable fields go in this list.
158+
was = value["type"]
159+
value["type"] = [was, "null"]

services/director/src/simcore_service_director/api/v0/schemas/project-v0.0.1.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@
157157
},
158158
"runHash": {
159159
"description": "the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated",
160-
"type": "string",
160+
"type": [
161+
"string",
162+
"null"
163+
],
161164
"examples": [
162165
"a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2"
163166
]

services/storage/src/simcore_service_storage/api/v0/openapi.yaml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,9 @@ paths:
18481848
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
18491849
runHash:
18501850
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
1851-
type: string
1851+
type:
1852+
- string
1853+
- 'null'
18521854
example:
18531855
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
18541856
inputs:
@@ -2290,7 +2292,9 @@ paths:
22902292
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
22912293
runHash:
22922294
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
2293-
type: string
2295+
type:
2296+
- string
2297+
- 'null'
22942298
example:
22952299
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
22962300
inputs:
@@ -2742,7 +2746,9 @@ paths:
27422746
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
27432747
runHash:
27442748
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
2745-
type: string
2749+
type:
2750+
- string
2751+
- 'null'
27462752
example:
27472753
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
27482754
inputs:
@@ -3294,7 +3300,9 @@ components:
32943300
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
32953301
runHash:
32963302
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
3297-
type: string
3303+
type:
3304+
- string
3305+
- 'null'
32983306
example:
32993307
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
33003308
inputs:

services/storage/src/simcore_service_storage/api/v0/schemas/project-v0.0.1.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@
157157
},
158158
"runHash": {
159159
"description": "the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated",
160-
"type": "string",
160+
"type": [
161+
"string",
162+
"null"
163+
],
161164
"examples": [
162165
"a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2"
163166
]

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

+37-10
Original file line numberDiff line numberDiff line change
@@ -6212,7 +6212,9 @@ paths:
62126212
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
62136213
runHash:
62146214
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
6215-
type: string
6215+
type:
6216+
- string
6217+
- 'null'
62166218
example:
62176219
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
62186220
inputs:
@@ -6785,7 +6787,9 @@ paths:
67856787
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
67866788
runHash:
67876789
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
6788-
type: string
6790+
type:
6791+
- string
6792+
- 'null'
67896793
example:
67906794
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
67916795
inputs:
@@ -7238,7 +7242,9 @@ paths:
72387242
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
72397243
runHash:
72407244
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
7241-
type: string
7245+
type:
7246+
- string
7247+
- 'null'
72427248
example:
72437249
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
72447250
inputs:
@@ -7809,7 +7815,9 @@ paths:
78097815
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
78107816
runHash:
78117817
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
7812-
type: string
7818+
type:
7819+
- string
7820+
- 'null'
78137821
example:
78147822
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
78157823
inputs:
@@ -8386,7 +8394,9 @@ paths:
83868394
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
83878395
runHash:
83888396
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
8389-
type: string
8397+
type:
8398+
- string
8399+
- 'null'
83908400
example:
83918401
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
83928402
inputs:
@@ -8954,7 +8964,9 @@ paths:
89548964
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
89558965
runHash:
89568966
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
8957-
type: string
8967+
type:
8968+
- string
8969+
- 'null'
89588970
example:
89598971
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
89608972
inputs:
@@ -9407,7 +9419,9 @@ paths:
94079419
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
94089420
runHash:
94099421
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
9410-
type: string
9422+
type:
9423+
- string
9424+
- 'null'
94119425
example:
94129426
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
94139427
inputs:
@@ -10000,7 +10014,9 @@ paths:
1000010014
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
1000110015
runHash:
1000210016
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
10003-
type: string
10017+
type:
10018+
- string
10019+
- 'null'
1000410020
example:
1000510021
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
1000610022
inputs:
@@ -10820,7 +10836,9 @@ paths:
1082010836
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
1082110837
runHash:
1082210838
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
10823-
type: string
10839+
type:
10840+
- string
10841+
- 'null'
1082410842
example:
1082510843
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
1082610844
inputs:
@@ -12093,7 +12111,9 @@ paths:
1209312111
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
1209412112
runHash:
1209512113
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
12096-
type: string
12114+
type:
12115+
- string
12116+
- 'null'
1209712117
example:
1209812118
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
1209912119
inputs:
@@ -12661,6 +12681,13 @@ paths:
1266112681
description: url of the latest screenshot of the node
1266212682
example:
1266312683
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
12684+
runHash:
12685+
description: the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated
12686+
type:
12687+
- string
12688+
- 'null'
12689+
example:
12690+
- a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
1266412691
inputs:
1266512692
type: object
1266612693
description: values of input properties

services/web/server/src/simcore_service_webserver/api/v0/schemas/project-v0.0.1.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@
157157
},
158158
"runHash": {
159159
"description": "the hex digest of the resolved inputs +outputs hash at the time when the last outputs were generated",
160-
"type": "string",
160+
"type": [
161+
"string",
162+
"null"
163+
],
161164
"examples": [
162165
"a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2"
163166
]

0 commit comments

Comments
 (0)