update django-ninja, including pydantic v2 and add provisional level api

This commit is contained in:
Laura Klünder 2023-11-18 21:29:35 +01:00
parent f89d069ab1
commit b2aa76ba2d
20 changed files with 510 additions and 61 deletions

View file

@ -1,5 +1,15 @@
from typing import Literal
from ninja import Schema
from pydantic import Field as APIField
class APIErrorSchema(Schema):
detail: str
class PolygonSchema(Schema):
type: Literal["Polygon"]
coordinates: list[list[tuple[float, float]]] = APIField(
example=[[1.5, 1.5], [1.5, 2.5], [2.5, 2.5], [2.5, 2.5]]
)