Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for dependency1 (0.46 sec)

  1. fastapi/param_functions.py

        ] = None,
        *,
        use_cache: Annotated[
            bool,
            Doc(
                """
                By default, after a dependency is called the first time in a request, if
                the dependency is declared again for the rest of the request (for example
                if the dependency is needed by several dependencies), the value will be
                re-used for the rest of the request.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 63K bytes
    - Viewed (0)
  2. fastapi/dependencies/utils.py

        assert callable(depends.dependency), (
            "A parameter-less dependency must have a callable dependency"
        )
        own_oauth_scopes: list[str] = []
        if isinstance(depends, params.Security) and depends.scopes:
            own_oauth_scopes.extend(depends.scopes)
        return get_dependant(
            path=path,
            call=depends.dependency,
            scope=depends.scope,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  3. tests/test_dependency_duplicates.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    client = TestClient(app)
    
    
    class Item(BaseModel):
        data: str
    
    
    def duplicate_dependency(item: Item):
        return item
    
    
    def dependency(item2: Item):
        return item2
    
    
    def sub_duplicate_dependency(
        item: Item, sub_item: Item = Depends(duplicate_dependency)
    ):
        return [item, sub_item]
    
    
    @app.post("/with-duplicates")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8K bytes
    - Viewed (0)
  4. .github/workflows/translate.yml

          - name: Set up Python
            uses: actions/setup-python@v6
            with:
              python-version: "3.11"
          - name: Setup uv
            uses: astral-sh/setup-uv@v7
            with:
              cache-dependency-glob: |
                requirements**.txt
                pyproject.toml
          - name: Install Dependencies
            run: uv pip install -r requirements-github-actions.txt -r requirements-translations.txt
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:48:45 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  5. fastapi/exceptions.py

    
    class FastAPIError(RuntimeError):
        """
        A generic, FastAPI-specific error.
        """
    
    
    class DependencyScopeError(FastAPIError):
        """
        A dependency declared that it depends on another dependency with an invalid
        (narrower) scope.
        """
    
    
    class ValidationException(Exception):
        def __init__(
            self,
            errors: Sequence[Any],
            *,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 6.8K bytes
    - Viewed (0)
  6. fastapi/datastructures.py

    from starlette.datastructures import UploadFile as StarletteUploadFile
    
    
    class UploadFile(StarletteUploadFile):
        """
        A file uploaded in a request.
    
        Define it as a *path operation function* (or dependency) parameter.
    
        If you are using a regular `def` function, you can use the `upload_file.file`
        attribute to access the raw standard Python file (blocking, not async), useful and
        needed for non-async code.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  7. fastapi/params.py

                include_in_schema=include_in_schema,
                json_schema_extra=json_schema_extra,
                **extra,
            )
    
    
    @dataclass(frozen=True)
    class Depends:
        dependency: Optional[Callable[..., Any]] = None
        use_cache: bool = True
        scope: Union[Literal["function", "request"], None] = None
    
    
    @dataclass(frozen=True)
    class Security(Depends):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 26.3K bytes
    - Viewed (0)
  8. docs/en/docs/release-notes.md

        * The cache can be disabled per dependency declaration, using `use_cache=False` as in `Depends(your_dependency, use_cache=False)`.
        * Updated docs at: [Using the same dependency multiple times](https://fastapi.tiangolo.com/tutorial/dependencies/sub-dependencies/#using-the-same-dependency-multiple-times).
        * PR [#292](https://github.com/tiangolo/fastapi/pull/292).
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:06:15 UTC 2025
    - 586.7K bytes
    - Viewed (0)
  9. fastapi/routing.py

                if not response_awaited:
                    raise FastAPIError(
                        "Response not awaited. There's a high chance that the "
                        "application code is raising an exception and a dependency with yield "
                        "has a block with a bare except, or a block with except Exception, "
                        "and is not raising the exception again. Read more about it in the "
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 174.6K bytes
    - Viewed (0)
Back to top