Skip to content
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

Update dependency fastapi to ^0.70 || ^0.71 || ^0.72 || ^0.73 || ^0.74 || ^0.75 || ^0.76 || ^0.77 || ^0.78 || ^0.79 || ^0.80 || ^0.81 || ^0.82 || ^0.83 || ^0.84 || ^0.85 || ^0.86 || ^0.87 || ^0.88 || ^0.89 || ^0.90 || ^0.91 || ^0.92 || ^0.93 || ^0.94 || ^0.95 || ^0.96 || ^0.97 || ^0.98 || ^0.99 || ^0.100.0 || ^0.101.0 || ^0.102.0 || ^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 #1083

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 20, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
fastapi (changelog) ^0.70 || ^0.71 || ^0.72 || ^0.73 || ^0.74 || ^0.75 || ^0.76 || ^0.77 || ^0.78 || ^0.79 || ^0.80 || ^0.81 || ^0.82 || ^0.83 || ^0.84 || ^0.85 || ^0.86 || ^0.87 || ^0.88 || ^0.89 || ^0.90 || ^0.91 || ^0.92 || ^0.93 || ^0.94 || ^0.95 || ^0.96 || ^0.97 || ^0.98 || ^0.99 || ^0.100.0 || ^0.101.0 || ^0.102.0 || ^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 -> ^0.70 || ^0.71 || ^0.72 || ^0.73 || ^0.74 || ^0.75 || ^0.76 || ^0.77 || ^0.78 || ^0.79 || ^0.80 || ^0.81 || ^0.82 || ^0.83 || ^0.84 || ^0.85 || ^0.86 || ^0.87 || ^0.88 || ^0.89 || ^0.90 || ^0.91 || ^0.92 || ^0.93 || ^0.94 || ^0.95 || ^0.96 || ^0.97 || ^0.98 || ^0.99 || ^0.100.0 || ^0.101.0 || ^0.102.0 || ^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 age adoption passing confidence

Release Notes

fastapi/fastapi (fastapi)

v0.115.0

Compare Source

Highlights

Now you can declare Query, Header, and Cookie parameters with Pydantic models. 🎉

Query Parameter Models

Use Pydantic models for Query parameters:

from typing import Annotated, Literal

from fastapi import FastAPI, Query
from pydantic import BaseModel, Field

app = FastAPI()

class FilterParams(BaseModel):
    limit: int = Field(100, gt=0, le=100)
    offset: int = Field(0, ge=0)
    order_by: Literal["created_at", "updated_at"] = "created_at"
    tags: list[str] = []

@​app.get("/items/")
async def read_items(filter_query: Annotated[FilterParams, Query()]):
    return filter_query

Read the new docs: Query Parameter Models.

Header Parameter Models

Use Pydantic models for Header parameters:

from typing import Annotated

from fastapi import FastAPI, Header
from pydantic import BaseModel

app = FastAPI()

class CommonHeaders(BaseModel):
    host: str
    save_data: bool
    if_modified_since: str | None = None
    traceparent: str | None = None
    x_tag: list[str] = []

@​app.get("/items/")
async def read_items(headers: Annotated[CommonHeaders, Header()]):
    return headers

Read the new docs: Header Parameter Models.

Cookie Parameter Models

Use Pydantic models for Cookie parameters:

from typing import Annotated

from fastapi import Cookie, FastAPI
from pydantic import BaseModel

app = FastAPI()

class Cookies(BaseModel):
    session_id: str
    fatebook_tracker: str | None = None
    googall_tracker: str | None = None

@​app.get("/items/")
async def read_items(cookies: Annotated[Cookies, Cookie()]):
    return cookies

Read the new docs: Cookie Parameter Models.

Forbid Extra Query (Cookie, Header) Parameters

Use Pydantic models to restrict extra values for Query parameters (also applies to Header and Cookie parameters).

To achieve it, use Pydantic's model_config = {"extra": "forbid"}:

from typing import Annotated, Literal

from fastapi import FastAPI, Query
from pydantic import BaseModel, Field

app = FastAPI()

class FilterParams(BaseModel):
    model_config = {"extra": "forbid"}

    limit: int = Field(100, gt=0, le=100)
    offset: int = Field(0, ge=0)
    order_by: Literal["created_at", "updated_at"] = "created_at"
    tags: list[str] = []

@​app.get("/items/")
async def read_items(filter_query: Annotated[FilterParams, Query()]):
    return filter_query

This applies to Query, Header, and Cookie parameters, read the new docs:

Features
  • ✨ Add support for Pydantic models for parameters using Query, Cookie, Header. PR #​12199 by @​tiangolo.
Translations
  • 🌐 Add Portuguese translation for docs/pt/docs/advanced/security/http-basic-auth.md. PR #​12195 by @​ceb10n.
Internal

v0.114.2

Compare Source

Fixes
Translations
Internal

v0.114.1

Compare Source

Refactors
  • ⚡️ Improve performance in request body parsing with a cache for internal model fields. PR #​12184 by @​tiangolo.
Docs
  • 📝 Remove duplicate line in docs for docs/en/docs/environment-variables.md. PR #​12169 by @​prometek.
Translations
Internal

Configuration

📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

…4 || ^0.75 || ^0.76 || ^0.77 || ^0.78 || ^0.79 || ^0.80 || ^0.81 || ^0.82 || ^0.83 || ^0.84 || ^0.85 || ^0.86 || ^0.87 || ^0.88 || ^0.89 || ^0.90 || ^0.91 || ^0.92 || ^0.93 || ^0.94 || ^0.95 || ^0.96 || ^0.97 || ^0.98 || ^0.99 || ^0.100.0 || ^0.101.0 || ^0.102.0 || ^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot added dependencies Pull requests that update a dependency file python labels Sep 20, 2024
@renovate renovate bot merged commit 4b6e858 into dev Sep 21, 2024
13 checks passed
@renovate renovate bot deleted the renovate/all-minor-patch branch September 21, 2024 01:40
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 python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants