Dan Albert b7439cbd17 Add metadata to FastAPI endpoints for OpenAPI.
operation_ids give us better function names when generating the
typescript API from the openapi.json. BaseModel.Config.title does the
same for type names. Response models (or 204 status codes) need to be
explicit or the API will be declared as returning any.
2022-03-06 17:12:00 -08:00

14 lines
238 B
Python

from __future__ import annotations
from pydantic import BaseModel
from game.server.leaflet import LeafletPoly
class NavMeshPolyJs(BaseModel):
poly: LeafletPoly
threatened: bool
class Config:
title = "NavMeshPoly"