- Sort Score
- Num 10 results
- Language All
Results 141 - 150 of 224 for BaseModel (0.22 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
scripts/label_approved.py
import logging from typing import Literal from github import Github from github.PullRequestReview import PullRequestReview from pydantic import BaseModel, SecretStr from pydantic_settings import BaseSettings class LabelSettings(BaseModel): await_label: str | None = None number: int default_config = {"approved-2": LabelSettings(await_label="awaiting-review", number=2)} class Settings(BaseSettings):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Jun 17 07:50:19 GMT 2025 - 2.2K bytes - Click Count (0) -
docs_src/security/tutorial003_an_py310.py
from typing import Annotated from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from pydantic import BaseModel fake_users_db = { "johndoe": { "username": "johndoe", "full_name": "John Doe", "email": "******@****.***", "hashed_password": "fakehashedsecret", "disabled": False, }, "alice": {Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Nov 24 19:03:06 GMT 2025 - 2.5K bytes - Click Count (0) -
tests/test_openapi_separate_input_output_schemas.py
from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel, computed_field class SubItem(BaseModel): subname: str sub_description: str | None = None tags: list[str] = [] model_config = {"json_schema_serialization_defaults_required": True} class Item(BaseModel): name: str description: str | None = None sub: SubItem | None = None
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 27.8K bytes - Click Count (0) -
tests/test_security_oauth2_optional.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 9.8K bytes - Click Count (0) -
fastapi/exceptions.py
""" ), ] = None, ) -> None: super().__init__(code=code, reason=reason) RequestErrorModel: type[BaseModel] = create_model("Request") WebSocketErrorModel: type[BaseModel] = create_model("WebSocket") class FastAPIError(RuntimeError): """ A generic, FastAPI-specific error. """ class DependencyScopeError(FastAPIError):Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 11 18:41:21 GMT 2026 - 7.3K bytes - Click Count (0) -
tests/test_multi_body_errors.py
from decimal import Decimal from dirty_equals import IsOneOf from fastapi import FastAPI from fastapi.testclient import TestClient from inline_snapshot import snapshot 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}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 6.7K bytes - Click Count (0) -
fastapi/openapi/models.py
class Server(BaseModelWithConfig): url: AnyUrl | str description: str | None = None variables: dict[str, ServerVariable] | None = None class Reference(BaseModel): ref: str = Field(alias="$ref") class Discriminator(BaseModel): propertyName: str mapping: dict[str, str] | None = None class XML(BaseModelWithConfig): name: str | None = None namespace: str | None = None
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 14.2K bytes - Click Count (0) -
tests/test_security_oauth2.py
from inline_snapshot import snapshot from pydantic import BaseModel app = FastAPI() reusable_oauth2 = OAuth2( flows={ "password": { "tokenUrl": "token", "scopes": {"read:users": "Read the users", "write:users": "Create users"}, } } ) class User(BaseModel): username: str # Here we use string annotations to test them
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 9.8K bytes - Click Count (0) -
tests/test_security_oauth2_optional_description.py
from inline_snapshot import snapshot from pydantic import BaseModel app = FastAPI() reusable_oauth2 = OAuth2( flows={ "password": { "tokenUrl": "token", "scopes": {"read:users": "Read the users", "write:users": "Create users"}, } }, description="OAuth2 security scheme", auto_error=False, ) class User(BaseModel): username: str
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 9.9K bytes - Click Count (0) -
tests/test_extra_routes.py
from fastapi import FastAPI from fastapi.responses import JSONResponse from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float | None = None @app.api_route("/items/{item_id}", methods=["GET"]) def get_items(item_id: str): return {"item_id": item_id} def get_not_decorated(item_id: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 14.7K bytes - Click Count (0)