- Sort Score
- Result 10 results
- Languages All
Results 91 - 100 of 4,280 for From (0.05 sec)
-
docs_src/additional_status_codes/tutorial001_an.py
from typing import Union from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse from typing_extensions import Annotated app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Annotated[Union[str, None], Body()] = None, size: Annotated[Union[int, None], Body()] = None, ):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 734 bytes - Viewed (0) -
docs_src/security/tutorial002_an_py39.py
from typing import Annotated, Union from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer from pydantic import BaseModel app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None def fake_decode_token(token):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 786 bytes - Viewed (0) -
tests/test_union_body.py
from typing import Optional, Union from dirty_equals import IsDict from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: Optional[str] = None class OtherItem(BaseModel): price: int @app.post("/items/") def save_union_body(item: Union[OtherItem, Item]): return {"item": item}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 4.6K 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) -
compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- // // p4 inherits from p3 // p3 inherits from p2 // p2 inherits from p1 // p1 inherits from p0 // p0 inherits from super model // // or we can show it graphically as: // // p4 ---> p3 ---> p2 ---> p1 ---> p0 --> super model //
Registered: Sun Nov 03 03:35:11 UTC 2024 - Last Modified: Fri Oct 25 12:31:46 UTC 2024 - 6.2K bytes - Viewed (0) -
.teamcity/src/test/kotlin/PromotionProjectTests.kt
assertEquals( listOf("SanityCheck", "Nightly Snapshot", "Nightly Snapshot (from QuickFeedback)", "Nightly Snapshot (from QuickFeedback) - Check Ready", "Nightly Snapshot (from QuickFeedback) - Upload", "Nightly Snapshot (from QuickFeedback) - Promote", "Publish Branch Snapshot (from Quick Feedback)", "Release - Milestone", "Start Release Cycle", "Start Release Cycle Test"), model.buildTypes.map { it.name }
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Tue Feb 13 14:18:23 UTC 2024 - 13.4K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/collect/testing/NavigableSetTestSuiteBuilder.java
TestSortedSetGenerator<E> delegate, Bound to, Bound from) { super(delegate, to, from); } @Override NavigableSet<E> createSubSet(SortedSet<E> sortedSet, E firstExclusive, E lastExclusive) { NavigableSet<E> set = (NavigableSet<E>) sortedSet; if (from == Bound.NO_BOUND && to == Bound.INCLUSIVE) { return set.headSet(lastInclusive, true); } else if (from == Bound.EXCLUSIVE && to == Bound.NO_BOUND) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 6.2K bytes - Viewed (0) -
tests/test_inherited_custom_class.py
import uuid import pytest from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel from .utils import needs_pydanticv1, needs_pydanticv2 class MyUuid: def __init__(self, uuid_string: str): self.uuid = uuid_string def __str__(self): return self.uuid @property # type: ignore def __class__(self): return uuid.UUID @property
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 17 04:13:50 UTC 2024 - 3K bytes - Viewed (0) -
fastapi/exceptions.py
from typing import Any, Dict, Optional, Sequence, Type, Union from pydantic import BaseModel, create_model from starlette.exceptions import HTTPException as StarletteHTTPException from starlette.exceptions import WebSocketException as StarletteWebSocketException from typing_extensions import Annotated, Doc class HTTPException(StarletteHTTPException): """ An HTTP exception you can raise in your own code to show errors to the client.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Apr 02 02:48:51 UTC 2024 - 4.9K bytes - Viewed (0) -
tests/test_custom_schema_fields.py
from fastapi import FastAPI from fastapi._compat import PYDANTIC_V2 from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str if PYDANTIC_V2: model_config = { "json_schema_extra": { "x-something-internal": {"level": 4}, } } else: class Config: schema_extra = {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 1.2K bytes - Viewed (0)