11 changed files with 11 additions and 185 deletions
@ -1,19 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: CommonHeaders = Header()): |
|
||||
return headers |
|
||||
@ -1,20 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: Annotated[CommonHeaders, Header()]): |
|
||||
return headers |
|
||||
@ -1,21 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
model_config = {"extra": "forbid"} |
|
||||
|
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: CommonHeaders = Header()): |
|
||||
return headers |
|
||||
@ -1,22 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
model_config = {"extra": "forbid"} |
|
||||
|
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: Annotated[CommonHeaders, Header()]): |
|
||||
return headers |
|
||||
@ -1,22 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
class Config: |
|
||||
extra = "forbid" |
|
||||
|
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: CommonHeaders = Header()): |
|
||||
return headers |
|
||||
@ -1,23 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
class Config: |
|
||||
extra = "forbid" |
|
||||
|
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: Annotated[CommonHeaders, Header()]): |
|
||||
return headers |
|
||||
@ -1,19 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items(headers: CommonHeaders = Header(convert_underscores=False)): |
|
||||
return headers |
|
||||
@ -1,22 +0,0 @@ |
|||||
from typing import List, Union |
|
||||
|
|
||||
from fastapi import FastAPI, Header |
|
||||
from pydantic import BaseModel |
|
||||
from typing_extensions import Annotated |
|
||||
|
|
||||
app = FastAPI() |
|
||||
|
|
||||
|
|
||||
class CommonHeaders(BaseModel): |
|
||||
host: str |
|
||||
save_data: bool |
|
||||
if_modified_since: Union[str, None] = None |
|
||||
traceparent: Union[str, None] = None |
|
||||
x_tag: List[str] = [] |
|
||||
|
|
||||
|
|
||||
@app.get("/items/") |
|
||||
async def read_items( |
|
||||
headers: Annotated[CommonHeaders, Header(convert_underscores=False)], |
|
||||
): |
|
||||
return headers |
|
||||
Loading…
Reference in new issue