Skip to content

Commit 11174a7

Browse files
fix: invalid field in example settings
1 parent 596d137 commit 11174a7

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

settings.example.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ scenes:
6565
color: "#ffcb7d"
6666
- legend_id: "Administration"
6767
color: "#6d9bde"
68-
description: "423 — Rector's office\n424 — Director's office"
68+
legend: "423 — Rector's office\n424 — Director's office"
6969
- legend_id: "Recruitment"
7070
color: "#de766d"
71-
description: "433 — Recruitment sector\n455 — Human resources department"
71+
legend: "433 — Recruitment sector\n455 — Human resources department"
7272
- scene_id: "university-floor-5"
7373
svg_file: "university-floor-5.svg"
7474
title: "Floor 5"

settings.schema.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,35 @@ $defs:
1717
title: Accounts
1818
type: object
1919
Area:
20+
additionalProperties: false
2021
properties:
2122
svg_polygon_id:
2223
anyOf:
2324
- type: string
2425
- type: 'null'
2526
default: null
27+
description: ID of the polygon in the SVG
2628
title: Svg Polygon Id
2729
title:
2830
anyOf:
2931
- type: string
3032
- type: 'null'
3133
default: null
34+
description: Title of the area
3235
title: Title
3336
legend_id:
3437
anyOf:
3538
- type: string
3639
- type: 'null'
3740
default: null
41+
description: ID of the legend (if any)
3842
title: Legend Id
3943
description:
4044
anyOf:
4145
- type: string
4246
- type: 'null'
4347
default: null
48+
description: Description of the area
4449
title: Description
4550
title: Area
4651
type: object
@@ -51,45 +56,55 @@ $defs:
5156
title: Environment
5257
type: string
5358
LegendEntry:
59+
additionalProperties: false
5460
properties:
5561
legend_id:
62+
description: ID of the legend
5663
title: Legend Id
5764
type: string
5865
color:
5966
anyOf:
6067
- type: string
6168
- type: 'null'
6269
default: null
70+
description: Color of the legend
6371
title: Color
6472
legend:
6573
anyOf:
6674
- type: string
6775
- type: 'null'
6876
default: null
77+
description: Description of the legend (may contain multiple lines)
6978
title: Legend
7079
required:
7180
- legend_id
7281
title: LegendEntry
7382
type: object
7483
Scene:
84+
additionalProperties: false
7585
properties:
7686
scene_id:
87+
description: ID of the scene
7788
title: Scene Id
7889
type: string
7990
title:
91+
description: Title of the scene
8092
title: Title
8193
type: string
8294
svg_file:
95+
description: Path to the SVG file in /static
8396
title: Svg File
8497
type: string
8598
legend:
8699
default: []
100+
description: Legend of the scene
87101
items:
88102
$ref: '#/$defs/LegendEntry'
89103
title: Legend
90104
type: array
91105
areas:
92106
default: []
107+
description: Areas of the scene
93108
items:
94109
$ref: '#/$defs/Area'
95110
title: Areas

src/config_schema.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SettingBaseModel(BaseModel):
1414
model_config = ConfigDict(use_attribute_docstrings=True, extra="forbid")
1515

1616

17-
class LegendEntry(BaseModel):
17+
class LegendEntry(SettingBaseModel):
1818
legend_id: str
1919
"ID of the legend"
2020
color: str | None = None
@@ -29,7 +29,7 @@ def set_legend_as_legend_id(self):
2929
return self
3030

3131

32-
class Area(BaseModel):
32+
class Area(SettingBaseModel):
3333
svg_polygon_id: str | None = None
3434
"ID of the polygon in the SVG"
3535
title: str | None = None
@@ -40,7 +40,7 @@ class Area(BaseModel):
4040
"Description of the area"
4141

4242

43-
class Scene(BaseModel):
43+
class Scene(SettingBaseModel):
4444
scene_id: str
4545
"ID of the scene"
4646
title: str

0 commit comments

Comments
 (0)