mirror of https://github.com/tiangolo/fastapi.git
🔖 Release version 0.113.0
This commit is contained in:
parent
179f838c36
commit
d86f660302
|
|
@ -7,6 +7,31 @@ hide:
|
||||||
|
|
||||||
## Latest Changes
|
## Latest Changes
|
||||||
|
|
||||||
|
## 0.113.0
|
||||||
|
|
||||||
|
Now you can declare form fields with Pydantic models:
|
||||||
|
|
||||||
|
```python
|
||||||
|
from typing import Annotated
|
||||||
|
|
||||||
|
from fastapi import FastAPI, Form
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
||||||
|
class FormData(BaseModel):
|
||||||
|
username: str
|
||||||
|
password: str
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/login/")
|
||||||
|
async def login(data: Annotated[FormData, Form()]):
|
||||||
|
return data
|
||||||
|
```
|
||||||
|
|
||||||
|
Read the new docs: [Form Models](https://fastapi.tiangolo.com/tutorial/request-form-models/).
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* ✨ Add support for Pydantic models in `Form` parameters. PR [#12129](https://github.com/fastapi/fastapi/pull/12129) by [@tiangolo](https://github.com/tiangolo).
|
* ✨ Add support for Pydantic models in `Form` parameters. PR [#12129](https://github.com/fastapi/fastapi/pull/12129) by [@tiangolo](https://github.com/tiangolo).
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
|
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
|
||||||
|
|
||||||
__version__ = "0.112.4"
|
__version__ = "0.113.0"
|
||||||
|
|
||||||
from starlette import status as status
|
from starlette import status as status
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue