Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 16, 2022

Bumps fastapi from 0.61.1 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, Query
app = 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, Query
app = FastAPI()
@​app.get("/items/{item_id}")
def main(
item_id: int = Path(gt=0),
</tr></table>

... (truncated)

Commits
  • 1876ebc 🔖 Release version 0.78.0
  • 1673b3e 📝 Update release notes
  • 1711403 📝 Update release notes
  • acab64b ✅ Add tests for required nonable parameters and body fields (#4907)
  • 0a8d687 📝 Update release notes
  • ca437cd 📝 Add docs recommending Union over Optional and migrate source examples (...
  • c5be1b0 📝 Update release notes
  • 9262fa8 ✨ Add support for not needing ... as default value in required Query(), Pat...
  • 31690dd 📝 Update release notes
  • 8b66b9c 🎨 Fix default value as set in tutorial for Path Operations Advanced Configura...
  • Additional commits viewable in compare view

Dependabot compatibility score

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 rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will 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 version will 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 dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [fastapi](https://github.com/tiangolo/fastapi) from 0.61.1 to 0.78.0.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](fastapi/fastapi@0.61.1...0.78.0)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label May 16, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 15, 2022

Superseded by #87.

@dependabot dependabot bot closed this Jul 15, 2022
@dependabot dependabot bot deleted the dependabot/pip/fastapi-0.78.0 branch July 15, 2022 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant