Skip to content

Commit

Permalink
Fix project schemas types
Browse files Browse the repository at this point in the history
  • Loading branch information
micorix committed Mar 13, 2023
1 parent 8d75187 commit ec9a721
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions po8klasie_fastapi/app/project/schemas.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
from typing import Any, Dict, List

from pydantic import BaseModel
from pydantic import BaseModel, validator


class MapOptionsSchema(BaseModel):
center: [float, float]
center: List[float]
zoom: float

@validator("center")
def check_len_eq_2(cls, value):
if len(value) != 2:
raise ValueError("map_options.center should have len == 2")
return value


class DefaultQuerySchema(BaseModel):
project_id: str
Expand Down

0 comments on commit ec9a721

Please sign in to comment.