-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAPI Example with multipart/form-data not showing up #10999
Comments
Using from typing import Annotated
from fastapi import FastAPI, UploadFile, Form, File
# Run using uvicorn main:app --reload
# Visit: http://127.0.0.1:8000/docs
app = FastAPI()
@app.post("/form-test")
async def form_test(
str_data: Annotated[str, Form(json_schema_extra={"example": "test"})],
file: Annotated[UploadFile, File()],
):
return But using only |
@Kludex Alias in |
|
Seems like currently you can specify |
As stated in the swagger.io documentation, the examples field should be a list of dict containing a key name and a value. Currently it is rendered as list of values in the openapi.json file source: https://swagger.io/docs/specification/adding-examples/ |
Discussed in #10937
Originally posted by SeeRich January 11, 2024
First Check
Commit to Help
Example Code
Description
The
HELLO
example is not shown in the docs.Operating System
Windows
Operating System Details
No response
FastAPI Version
0.108.0
Pydantic Version
2.5.3
Python Version
3.11.3
Additional Context
No response
The text was updated successfully, but these errors were encountered: