florgon / api

πŸ”§ Core API for our Ecosystem (including services, SSO). πŸ‘¨β€πŸ’» Deployed and used in production. πŸ“— Documented with swagger.
https://api.florgon.com/v1/docs
Other
27 stars 4 forks source link

Bump fastapi from 0.79.1 to 0.80.0 in /src/api #151

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps fastapi from 0.79.1 to 0.80.0.

Release notes

Sourced from fastapi's releases.

0.80.0

Breaking Changes - Fixes

If you are using response_model with some type that doesn't include None but the function is returning None, it will now raise an internal server error, because you are returning invalid data that violates the contract in response_model. Before this release it would allow breaking that contract returning None.

For example, if you have an app like this:

from fastapi import FastAPI
from pydantic import BaseModel

class Item(BaseModel): name: str price: Optional[float] = None owner_ids: Optional[List[int]] = None

app = FastAPI()

@​app.get("/items/invalidnone", response_model=Item) def get_invalid_none(): return None

...calling the path /items/invalidnone will raise an error, because None is not a valid type for the response_model declared with Item.

You could also be implicitly returning None without realizing, for example:

from fastapi import FastAPI
from pydantic import BaseModel

class Item(BaseModel): name: str price: Optional[float] = None owner_ids: Optional[List[int]] = None

app = FastAPI()

@​app.get("/items/invalidnone", response_model=Item) def get_invalid_none(): if flag: return {"name": "foo"} # if flag is False, at this point the function will implicitly return None

If you have path operations using response_model that need to be allowed to return None, make it explicit in response_model using Union[Something, None]:

</tr></table> 

... (truncated)

Commits
  • 7d6e707 πŸ”– Release version 0.80.0
  • 18819f9 πŸ“ Update release notes
  • ad65e72 πŸ“ Update release notes
  • ec072d7 ⬆ Upgrade Swagger UI copy of oauth2-redirect.html to include fixes for flav...
  • 09acce4 πŸ“ Update release notes
  • f6808e7 β™» Strip empty whitespace from description extracted from docstrings (#2821)
  • f8f5281 πŸ“ Update release notes
  • b993b4a πŸ› Fix cached dependencies when using a dependency in Security() and other p...
  • 982911f πŸ“ Update release notes
  • 634cf22 πŸ› Fix response_model not invalidating None (#2725)
  • 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)