enjoy an awesome broken display viewpoint
This commit is contained in:
parent
389e9ee52b
commit
505a59091c
4 changed files with 170 additions and 12 deletions
|
@ -1,6 +1,7 @@
|
|||
from typing import Literal
|
||||
from typing import Annotated, Literal, Union
|
||||
|
||||
from ninja import Schema
|
||||
from pydantic import Discriminator
|
||||
from pydantic import Field as APIField
|
||||
|
||||
from c3nav.api.utils import NonEmptyStr
|
||||
|
@ -43,3 +44,13 @@ class PointSchema(Schema):
|
|||
coordinates: tuple[float, float] = APIField(
|
||||
example=[1, 2.5]
|
||||
)
|
||||
|
||||
|
||||
GeometrySchema = Annotated[
|
||||
Union[
|
||||
PolygonSchema,
|
||||
LineStringSchema,
|
||||
PointSchema,],
|
||||
Discriminator("type"),
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue