mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
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:
@@ -1,16 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dcs.mapping import LatLng
|
||||
from pydantic.dataclasses import dataclass
|
||||
from pydantic import BaseModel
|
||||
|
||||
from game.ato import FlightWaypoint
|
||||
from game.ato.flightwaypointtype import FlightWaypointType
|
||||
from game.server.leaflet import LeafletPoint
|
||||
|
||||
|
||||
@dataclass
|
||||
class FlightWaypointJs:
|
||||
class FlightWaypointJs(BaseModel):
|
||||
name: str
|
||||
position: LatLng
|
||||
position: LeafletPoint
|
||||
altitude_ft: float
|
||||
altitude_reference: str
|
||||
is_movable: bool
|
||||
|
||||
Reference in New Issue
Block a user