fastapi-realworld-example-app
fastapi-realworld-example-app copied to clipboard
Bump fastapi from 0.73.0 to 0.78.0
Bumps fastapi from 0.73.0 to 0.78.0.
Release notes
Sourced from fastapi's releases.
0.78.0
Features
✨ Add support for omitting
...as default value when declaring required parameters with:
Path()
Query()
Header()
Cookie()
Body()
Form()
File()New docs at Tutorial - Query Parameters and String Validations - Make it required. PR #4906 by
@tiangolo.Up to now, declaring a required parameter while adding additional validation or metadata needed using
...(Ellipsis).For example:
from fastapi import Cookie, FastAPI, Header, Path, Queryapp = FastAPI()
@app.get("/items/{item_id}") def main( item_id: int = Path(default=..., gt=0), query: str = Query(default=..., max_length=10), session: str = Cookie(default=..., min_length=3), x_trace: str = Header(default=..., title="Tracing header"), ): return {"message": "Hello World"}...all these parameters are required because the default value is
...(Ellipsis).But now it's possible and supported to just omit the default value, as would be done with Pydantic fields, and the parameters would still be required.
✨ For example, this is now supported:
from fastapi import Cookie, FastAPI, Header, Path, Queryapp = FastAPI()
@app.get("/items/{item_id}") def main( item_id: int = Path(gt=0), </tr></table>
... (truncated)
Commits
1876ebc🔖 Release version 0.78.01673b3e📝 Update release notes1711403📝 Update release notesacab64b✅ Add tests for required nonable parameters and body fields (#4907)0a8d687📝 Update release notesca437cd📝 Add docs recommendingUnionoverOptionaland migrate source examples (...c5be1b0📝 Update release notes9262fa8✨ Add support for not needing...as default value in required Query(), Pat...31690dd📝 Update release notes8b66b9c🎨 Fix default value as set in tutorial for Path Operations Advanced Configura...- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Codecov Report
Merging #282 (84e3616) into master (dc1aa66) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #282 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 69 69
Lines 1478 1478
Branches 121 121
=========================================
Hits 1478 1478
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update dc1aa66...84e3616. Read the comment docs.
Superseded by #288.