Skip to content

Commit 572fdbe

Browse files
authored
Merge pull request #22 from mapswipe/feat/validate-tutorial-types
fix: update schema for validate tutorial
2 parents fe60e6c + 05ee791 commit 572fdbe

File tree

8 files changed

+98
-187
lines changed

8 files changed

+98
-187
lines changed

functions/definition/tutorial/common.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ FbBaseTutorial:
104104
tutorialDraftId:
105105
type: string
106106
deprecated: true
107+
screens:
108+
type:
109+
type: list
110+
elementType: FbScreen
107111

108112
FbBaseTutorialGroup:
109113
model: alias

functions/definition/tutorial/compare.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,12 @@ FbCompareTutorial:
1515
type: FbObjRasterTileServer
1616
zoomLevel:
1717
type: int
18-
screens:
19-
type:
20-
type: list
21-
elementType: FbScreen
22-
23-
FbCompareTutorialGroup:
24-
model: alias
25-
type:
26-
type: object
27-
fields:
28-
xMax:
29-
type: int
30-
xMin:
31-
type: int
32-
yMax:
33-
type: int
34-
yMin:
35-
type: int
3618

3719
FbCompareTutorialTask:
3820
model: alias
3921
type:
4022
type: object
4123
fields:
42-
geometry: # NOTE: initially empty string
43-
type: string
44-
groupId:
45-
type: int
46-
projectId:
47-
type: string
48-
referenceAnswer:
49-
type: int
50-
screen:
51-
type: int
52-
taskId:
53-
type: string
54-
taskId_real:
55-
type: string
56-
taskX:
57-
type: int
58-
taskY:
59-
type: int
6024
url:
6125
type: string
6226
urlB:

functions/definition/tutorial/completeness.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,12 @@ FbCompletenessTutorial:
1717
type: FbObjUnifiedOverlayTileServer
1818
zoomLevel:
1919
type: int
20-
screens:
21-
type:
22-
type: list
23-
elementType: FbScreen
24-
25-
FbCompletenessTutorialGroup:
26-
model: alias
27-
type:
28-
type: object
29-
fields:
30-
xMax:
31-
type: int
32-
xMin:
33-
type: int
34-
yMax:
35-
type: int
36-
yMin:
37-
type: int
3820

3921
FbCompletenessTutorialTask:
4022
model: alias
4123
type:
4224
type: object
4325
fields:
44-
geometry: # NOTE: initially empty string
45-
type: string
46-
groupId:
47-
type: int
48-
projectId:
49-
type: string
50-
referenceAnswer:
51-
type: int
52-
screen:
53-
type: int
54-
taskId:
55-
type: string
56-
taskId_real:
57-
type: string
58-
taskX:
59-
type: int
60-
taskY:
61-
type: int
6226
url:
6327
type: string
6428
urlB:

functions/definition/tutorial/find.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,11 @@ FbFindTutorial:
1313
type: FbObjRasterTileServer
1414
zoomLevel:
1515
type: int
16-
screens:
17-
type:
18-
type: list
19-
elementType: FbScreen
20-
21-
FbFindTutorialGroup:
22-
model: alias
23-
type:
24-
type: object
25-
fields:
26-
xMax:
27-
type: int
28-
xMin:
29-
type: int
30-
yMax:
31-
type: int
32-
yMin:
33-
type: int
3416

3517
FbFindTutorialTask:
3618
model: alias
3719
type:
3820
type: object
3921
fields:
40-
geometry: # NOTE: initially empty string
41-
type: string
42-
groupId:
43-
type: int
44-
projectId:
45-
type: string
46-
referenceAnswer:
47-
type: int
48-
screen:
49-
type: int
50-
taskId:
51-
type: string
52-
taskId_real:
53-
type: string
54-
taskX:
55-
type: int
56-
taskY:
57-
type: int
5822
url:
5923
type: string
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FbTileMapServiceTutorialGroup:
2+
model: alias
3+
type:
4+
type: object
5+
fields:
6+
xMax:
7+
type: int
8+
xMin:
9+
type: int
10+
yMax:
11+
type: int
12+
yMin:
13+
type: int
14+
15+
FbTileMapServiceTutorialTask:
16+
model: alias
17+
type:
18+
type: object
19+
fields:
20+
geometry: # NOTE: initially empty string
21+
type: string
22+
groupId:
23+
type: int
24+
projectId:
25+
type: string
26+
referenceAnswer:
27+
type: int
28+
screen:
29+
type: int
30+
taskId:
31+
type: string
32+
taskId_real:
33+
type: string
34+
taskX:
35+
type: int
36+
taskY:
37+
type: int

functions/definition/tutorial/validate.yaml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ FbValidateTutorial:
55
type:
66
type: object
77
fields:
8-
inputGeometries: # NOTE: local path to geometry file
8+
# NOTE: local path to geometry file
9+
inputGeometries:
910
type: string
11+
deprecated: true
1012
projectType:
1113
type:
1214
type: literal
@@ -15,10 +17,7 @@ FbValidateTutorial:
1517
type: FbObjRasterTileServer
1618
zoomLevel:
1719
type: int
18-
screens:
19-
type:
20-
type: list
21-
elementType: FbScreen
20+
deprecated: true
2221
customOptions:
2322
optional: true
2423
type:
@@ -30,14 +29,12 @@ FbValidateTutorialTaskProperties:
3029
type:
3130
type: object
3231
fields:
33-
building:
34-
type: string
35-
description:
36-
type: string
37-
reference:
38-
type: string # NOTE: not sure if this is int or string
32+
id:
33+
type: int
3934
screen:
40-
type: string # NOTE: not sure if this is int or string
35+
type: int
36+
reference:
37+
type: int
4138

4239
FbValidateTutorialTask:
4340
model: alias
@@ -50,9 +47,5 @@ FbValidateTutorialTask:
5047
type: unknown
5148
properties:
5249
type: FbValidateTutorialTaskProperties
53-
screen:
54-
type: int
55-
reference:
56-
type: int
5750
geometry: # NOTE: geometry as WKT
5851
type: string

functions/generated/pyfirebase/pyfirebase_mapswipe/extended_models.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ class FbProject(
1414
class Config: # type: ignore[reportIncompatibleVariableOverride]
1515
use_enum_values = False
1616
frozen = True
17-
# NOTE: We need to allow extra fields as FbProject
18-
# is not a complete project representation
19-
extra = "allow"
17+
extra = "forbid"
2018

2119

2220
class FbMappingGroup(
@@ -48,3 +46,33 @@ class Config: # type: ignore[reportIncompatibleVariableOverride]
4846
use_enum_values = False
4947
frozen = True
5048
extra = "forbid"
49+
50+
51+
class FbFindTutorialTaskComplete(
52+
models.FbTileMapServiceTutorialTask,
53+
models.FbFindTutorialTask,
54+
):
55+
class Config: # type: ignore[reportIncompatibleVariableOverride]
56+
use_enum_values = True
57+
frozen = True
58+
extra = "forbid"
59+
60+
61+
class FbCompareTutorialTaskComplete(
62+
models.FbTileMapServiceTutorialTask,
63+
models.FbCompareTutorialTask,
64+
):
65+
class Config: # type: ignore[reportIncompatibleVariableOverride]
66+
use_enum_values = True
67+
frozen = True
68+
extra = "forbid"
69+
70+
71+
class FbCompletenessTutorialTaskComplete(
72+
models.FbTileMapServiceTutorialTask,
73+
models.FbCompletenessTutorialTask,
74+
):
75+
class Config: # type: ignore[reportIncompatibleVariableOverride]
76+
use_enum_values = True
77+
frozen = True
78+
extra = "forbid"

0 commit comments

Comments
 (0)