Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for density (0.2 sec)

  1. tests/test_enforce_once_required_parameter.py

        actual_schema = response.json()
        assert actual_schema == expected_schema
    
    
    def test_get_invalid():
        response = client.get("/foo")
        assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
    
    
    def test_get_valid():
        response = client.get("/foo", params={"client_id": "bar"})
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  2. fastapi/exception_handlers.py

    from fastapi.websockets import WebSocket
    from starlette.exceptions import HTTPException
    from starlette.requests import Request
    from starlette.responses import JSONResponse, Response
    from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION
    
    
    async def http_exception_handler(request: Request, exc: HTTPException) -> Response:
        headers = getattr(exc, "headers", None)
        if not is_body_allowed_for_status_code(exc.status_code):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  3. fastapi/openapi/utils.py

        generate_operation_id_for_path,
        is_body_allowed_for_status_code,
    )
    from starlette.responses import JSONResponse
    from starlette.routing import BaseRoute
    from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
    from typing_extensions import Literal
    
    validation_error_definition = {
        "title": "ValidationError",
        "type": "object",
        "properties": {
            "loc": {
                "title": "Location",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  4. docs/sts/web-identity.py

        # we can now use the id_token as much as we want to access protected resources.
        tokens = json.loads(id_token_response.text)
        id_token = tokens['id_token']
    
        response = sts_client.assume_role_with_web_identity(
            RoleArn='arn:aws:iam::123456789012:user/svc-internal-api',
            RoleSessionName='test',
            WebIdentityToken=id_token,
            DurationSeconds=3600
        )
    
        s3_resource = boto3.resource('s3',
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
  5. docs_src/handling_errors/tutorial005.py

    app = FastAPI()
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request: Request, exc: RequestValidationError):
        return JSONResponse(
            status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
            content=jsonable_encoder({"detail": exc.errors(), "body": exc.body}),
        )
    
    
    class Item(BaseModel):
        title: str
        size: int
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 667 bytes
    - Viewed (0)
Back to top