Browse Source

♻️ Refactor UploadFile JSON Schema to use contentMediaType (OpenAPI 3.1)

pull/14953/head
Sebastián Ramírez 5 months ago
parent
commit
f4be45eb73
  1. 2
      fastapi/datastructures.py

2
fastapi/datastructures.py

@ -139,7 +139,7 @@ class UploadFile(StarletteUploadFile):
def __get_pydantic_json_schema__(
cls, core_schema: Mapping[str, Any], handler: GetJsonSchemaHandler
) -> dict[str, Any]:
return {"type": "string", "format": "binary"}
return {"type": "string", "contentMediaType": "application/octet-stream"}
@classmethod
def __get_pydantic_core_schema__(

Loading…
Cancel
Save