24 lines
620 B
Python
24 lines
620 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class ApiModel(BaseModel):
|
|
"""Base schema with loose extra handling for Directus-backed records.
|
|
|
|
Directus can include additional fields such as accountability metadata or
|
|
relational expansions. Allowing extra keys keeps the DTO layer resilient
|
|
while we gradually tighten contracts collection by collection.
|
|
"""
|
|
|
|
model_config = ConfigDict(extra="allow")
|
|
|
|
|
|
class ItemListResponse(ApiModel):
|
|
"""Common list envelope so admin routes all respond in the same shape."""
|
|
|
|
items: list[Any]
|
|
|