- Sort Score
- Result 10 results
- Languages All
Results 461 - 470 of 835 for typing (0.08 sec)
-
tests/test_router_events.py
from contextlib import asynccontextmanager from typing import AsyncGenerator, Dict, Union import pytest from fastapi import APIRouter, FastAPI, Request from fastapi.testclient import TestClient from pydantic import BaseModel class State(BaseModel): app_startup: bool = False app_shutdown: bool = False router_startup: bool = False router_shutdown: bool = False sub_router_startup: bool = False
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 24 19:09:52 UTC 2024 - 7.3K bytes - Viewed (0) -
tests/test_security_oauth2_optional.py
from typing import Optional from dirty_equals import IsDict from fastapi import Depends, FastAPI, Security from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() reusable_oauth2 = OAuth2( flows={ "password": { "tokenUrl": "token", "scopes": {"read:users": "Read the users", "write:users": "Create users"},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 10.8K bytes - Viewed (0) -
tests/test_sub_callbacks.py
from typing import Optional from dirty_equals import IsDict from fastapi import APIRouter, FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel, HttpUrl app = FastAPI() class Invoice(BaseModel): id: str title: Optional[str] = None customer: str total: float class InvoiceEvent(BaseModel): description: str paid: bool class InvoiceEventReceived(BaseModel):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 13.8K bytes - Viewed (0) -
docs_src/security/tutorial004_an.py
from datetime import datetime, timedelta, timezone from typing import Union import jwt from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from jwt.exceptions import InvalidTokenError from passlib.context import CryptContext from pydantic import BaseModel from typing_extensions import Annotated # to get a string like this run: # openssl rand -hex 32
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon May 20 17:37:28 UTC 2024 - 4.2K bytes - Viewed (0) -
tests/test_filter_pydantic_sub_model_pv2.py
from typing import Optional import pytest from dirty_equals import HasRepr, IsDict, IsOneOf from fastapi import Depends, FastAPI from fastapi.exceptions import ResponseValidationError from fastapi.testclient import TestClient from .utils import needs_pydanticv2 @pytest.fixture(name="client") def get_client(): from pydantic import BaseModel, ValidationInfo, field_validator app = FastAPI() class ModelB(BaseModel):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 6.3K bytes - Viewed (0) -
tests/test_jsonable_encoder.py
from collections import deque from dataclasses import dataclass from datetime import datetime, timezone from decimal import Decimal from enum import Enum from pathlib import PurePath, PurePosixPath, PureWindowsPath from typing import Optional import pytest from fastapi._compat import PYDANTIC_V2, Undefined from fastapi.encoders import jsonable_encoder from pydantic import BaseModel, Field, ValidationError
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 9K bytes - Viewed (0) -
tests/test_param_include_in_schema.py
from typing import Optional import pytest from fastapi import Cookie, FastAPI, Header, Path, Query from fastapi.testclient import TestClient app = FastAPI() @app.get("/hidden_cookie") async def hidden_cookie( hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False), ): return {"hidden_cookie": hidden_cookie} @app.get("/hidden_header") async def hidden_header(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 7.4K bytes - Viewed (0) -
fastapi/utils.py
import re import warnings from dataclasses import is_dataclass from typing import ( TYPE_CHECKING, Any, Dict, MutableMapping, Optional, Set, Type, Union, cast, ) from weakref import WeakKeyDictionary import fastapi from fastapi._compat import ( PYDANTIC_V2, BaseConfig, ModelField, PydanticSchemaGenerationError, Undefined, UndefinedType,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 31 23:46:03 UTC 2024 - 7.8K bytes - Viewed (0) -
tests/test_multi_body_errors.py
from decimal import Decimal from typing import List from dirty_equals import IsDict, IsOneOf from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel, condecimal app = FastAPI() class Item(BaseModel): name: str age: condecimal(gt=Decimal(0.0)) # type: ignore @app.post("/items/") def save_item_no_body(item: List[Item]): return {"item": item}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.6K bytes - Viewed (0) -
docs_src/security/tutorial005.py
from datetime import datetime, timedelta, timezone from typing import List, Union import jwt from fastapi import Depends, FastAPI, HTTPException, Security, status from fastapi.security import ( OAuth2PasswordBearer, OAuth2PasswordRequestForm, SecurityScopes, ) from jwt.exceptions import InvalidTokenError from passlib.context import CryptContext from pydantic import BaseModel, ValidationError # to get a string like this run:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Mon May 20 17:37:28 UTC 2024 - 5.2K bytes - Viewed (0)