Closed pgjones closed 1 year ago
Maybe via an API like,
class WithFile(BaseModel): description: str files: list[File]
The presence of File should change the encoding type to multipart/fom-encoded and be filled with the await request.files data.
File
await request.files
I don't think I need a DataSource change, as either url or multipart encoded are fine Form types.
The File class needs something like this, so that pydantic creates the correct schema.
@classmethod def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: field_schema.update({"type": "string", "format": "binary"})
Changed my mind about the datasource, see 766666d04a112e076a3b2945834e7f461d197a04
Maybe via an API like,
The presence of
File
should change the encoding type to multipart/fom-encoded and be filled with theawait request.files
data.I don't think I need a DataSource change, as either url or multipart encoded are fine Form types.
The
File
class needs something like this, so that pydantic creates the correct schema.