mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-04 20:20:51 -05:00
* ✨ Do not require default value in Query(), Path(), Header(), etc * 📝 Update source examples for docs with default and required values * ✅ Update tests with new default values and not required Ellipsis * 📝 Update docs for Query params and update info about default value, required, Ellipsis
13 lines
259 B
Python
13 lines
259 B
Python
from typing import Optional
|
|
|
|
from fastapi import FastAPI, Header
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(
|
|
strange_header: Optional[str] = Header(default=None, convert_underscores=False)
|
|
):
|
|
return {"strange_header": strange_header}
|