mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-23 22:29:34 -05:00
* 🔧 Update pre-commit, use ruff format * ⬆️ Upgrade dependencies, use Ruff for formatting * 🔧 Update Ruff config * 🔨 Update lint and format scripts, use Ruff * 🎨 Format internals with Ruff * 🎨 Format docs scripts * 🎨 Format tests * 🎨 Format extra commas in src for docs * 📝 Update docs mentioning `@lru_cache()`, use `@lru_cache` instead to keep consistency with the format * 🎨 Update src for docs, use plain `@lru_cache` * 🎨 Update src for docs format and docs references
15 lines
288 B
Python
15 lines
288 B
Python
from typing import Annotated, Union
|
|
|
|
from fastapi import FastAPI, Header
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(
|
|
strange_header: Annotated[
|
|
Union[str, None], Header(convert_underscores=False)
|
|
] = None,
|
|
):
|
|
return {"strange_header": strange_header}
|