schema.py 279 B

123456789101112
  1. from ninja import Field, Schema
  2. from pydantic import RootModel
  3. class ChecksumSchema(Schema):
  4. name: str | None = None
  5. debug_id: str | None = None
  6. chunks: list[str] = Field(default_factory=list)
  7. class AssemblePayload(RootModel):
  8. root: dict[str, ChecksumSchema]