Skip to content

Commit 1a37982

Browse files
authored
Merge pull request #12 from mapswipe/fix/custom-options-optional
fix: make customOptions non-mandatory
2 parents de6d17a + 9ec0e87 commit 1a37982

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

functions/definition/models.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ FbProjectValidateCreateOnlyInput:
362362
type: object
363363
fields:
364364
customOptions:
365-
# optional: true
365+
optional: true
366366
type:
367367
type: list
368368
elementType: FbObjCustomOption

functions/definition/tutorial/validate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FbValidateTutorial:
1818
type: list
1919
elementType: FbScreen
2020
customOptions:
21-
# optional: true
21+
optional: true
2222
type:
2323
type: list
2424
elementType: FbObjCustomOption

functions/generated/pyfirebase/pyfirebase_mapswipe/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None:
325325

326326
class FbProjectValidateCreateOnlyInput(TypesyncModel):
327327
"""Represents VALIDATE project fields that are valid while creating a project"""
328-
customOptions: typing.List[FbObjCustomOption]
328+
customOptions: typing.Union[TypesyncUndefined, typing.List[FbObjCustomOption]] = UNDEFINED
329329
tileServer: FbObjRasterTileServer
330330
inputType: FbEnumValidateInputType
331331
filter: typing.Union[TypesyncUndefined, str] = UNDEFINED
@@ -336,6 +336,8 @@ class Config:
336336
extra = 'forbid'
337337

338338
def __setattr__(self, name: str, value: typing.Any) -> None:
339+
if name == "customOptions" and value is None:
340+
raise ValueError("'customOptions' field cannot be set to None")
339341
if name == "filter" and value is None:
340342
raise ValueError("'filter' field cannot be set to None")
341343
if name == "TMId" and value is None:
@@ -842,13 +844,15 @@ class FbValidateTutorial(TypesyncModel):
842844
tileServer: FbObjRasterTileServer
843845
zoomLevel: int
844846
screens: typing.List[FbScreen]
845-
customOptions: typing.List[FbObjCustomOption]
847+
customOptions: typing.Union[TypesyncUndefined, typing.List[FbObjCustomOption]] = UNDEFINED
846848

847849
class Config:
848850
use_enum_values = True
849851
extra = 'forbid'
850852

851853
def __setattr__(self, name: str, value: typing.Any) -> None:
854+
if name == "customOptions" and value is None:
855+
raise ValueError("'customOptions' field cannot be set to None")
852856
super().__setattr__(name, value)
853857

854858
class FbValidateTutorialTaskProperties(TypesyncModel):

0 commit comments

Comments
 (0)