mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-13 02:28:10 +00:00
size validation (#156)
This commit is contained in:
@ -562,6 +562,12 @@ class Scaleset(BaseModel):
|
|||||||
client_object_id: Optional[UUID]
|
client_object_id: Optional[UUID]
|
||||||
tags: Dict[str, str] = Field(default_factory=lambda: {})
|
tags: Dict[str, str] = Field(default_factory=lambda: {})
|
||||||
|
|
||||||
|
@validator("size", allow_reuse=True)
|
||||||
|
def check_size(cls, value: int) -> int:
|
||||||
|
if value < 0:
|
||||||
|
raise ValueError("Invalid scaleset size")
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
class NotificationConfig(BaseModel):
|
class NotificationConfig(BaseModel):
|
||||||
config: NotificationTemplate
|
config: NotificationTemplate
|
||||||
|
Reference in New Issue
Block a user