Fix FastAPI doc pages.

We can't directly use frozen dataclasses from pydcs in our interface
because pydantic can't process them. Pydantic is able to automatically
convert to our modelview type from the pydcs type though.
This commit is contained in:
Dan Albert
2022-02-25 16:34:11 -08:00
parent 45e76e12b6
commit d6e82d44fc
6 changed files with 25 additions and 16 deletions

View File

@@ -1,9 +1,8 @@
from __future__ import annotations
from dcs.mapping import LatLng
from pydantic import BaseModel
from game.server.leaflet import LeafletPoly, ShapelyUtil
from game.server.leaflet import LeafletPoint, LeafletPoly, ShapelyUtil
from game.theater import ConflictTheater
from game.threatzones import ThreatZones
@@ -15,7 +14,7 @@ class MapZonesJs(BaseModel):
class UnculledZoneJs(BaseModel):
position: LatLng
position: LeafletPoint
radius: float