Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 93 for Optional (0.18 sec)

  1. tests/test_security_oauth2_optional.py

    
    def get_current_user(oauth_header: Optional[str] = Security(reusable_oauth2)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
        return form_data
    
    
    @app.get("/users/me")
    def read_users_me(current_user: Optional[User] = Depends(get_current_user)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_optional_description.py

    
    def get_current_user(oauth_header: Optional[str] = Security(reusable_oauth2)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
        return form_data
    
    
    @app.get("/users/me")
    def read_users_me(current_user: Optional[User] = Depends(get_current_user)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  3. fastapi/params.py

            serialization_alias: Union[str, None] = None,
            title: Optional[str] = None,
            description: Optional[str] = None,
            gt: Optional[float] = None,
            ge: Optional[float] = None,
            lt: Optional[float] = None,
            le: Optional[float] = None,
            min_length: Optional[int] = None,
            max_length: Optional[int] = None,
            pattern: Optional[str] = None,
            regex: Annotated[
                Optional[str],
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  4. pdm_build.py

        # Get main dependencies
        dependencies: List[str] = metadata.get("dependencies", [])
        # Add optional dependencies to the default dependencies for this (non-slim) package
        for include_optional in include_optional_dependencies:
            optional_dependencies_group = optional_dependencies.get(include_optional, [])
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 30 06:38:13 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  5. fastapi/param_functions.py

        ] = None,
        title: Annotated[
            Optional[str],
            Doc(
                """
                Human-readable title.
                """
            ),
        ] = None,
        description: Annotated[
            Optional[str],
            Doc(
                """
                Human-readable description.
                """
            ),
        ] = None,
        gt: Annotated[
            Optional[float],
            Doc(
                """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  6. fastapi/security/http.py

            scheme: str,
            scheme_name: Optional[str] = None,
            description: Optional[str] = None,
            auto_error: bool = True,
        ):
            self.model = HTTPBaseModel(scheme=scheme, description=description)
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        async def __call__(
            self, request: Request
        ) -> Optional[HTTPAuthorizationCredentials]:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  7. fastapi/security/oauth2.py

        scope: Optional string. Several scopes (each one a string) separated by spaces. E.g.
            "items:read items:write users:read profile openid"
        client_id: optional string. OAuth2 recommends sending the client_id and client_secret (if any)
            using HTTP Basic auth, as: client_id:client_secret
        client_secret: optional string. OAuth2 recommends sending the client_id and client_secret (if any)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  8. tests/test_query.py

            }
        )
    
    
    def test_query_optional():
        response = client.get("/query/optional")
        assert response.status_code == 200
        assert response.json() == "foo bar"
    
    
    def test_query_optional_query_baz():
        response = client.get("/query/optional?query=baz")
        assert response.status_code == 200
        assert response.json() == "foo bar baz"
    
    
    def test_query_optional_not_declared_baz():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  9. fastapi/utils.py

    
    def create_response_field(
        name: str,
        type_: Type[Any],
        class_validators: Optional[Dict[str, Validator]] = None,
        default: Optional[Any] = Undefined,
        required: Union[bool, UndefinedType] = Undefined,
        model_config: Type[BaseConfig] = BaseConfig,
        field_info: Optional[FieldInfo] = None,
        alias: Optional[str] = None,
        mode: Literal["validation", "serialization"] = "validation",
    ) -> ModelField:
        """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  10. docs/uk/docs/python-types.md

    #### Possibly `None` (Optional)
    
    Ви можете оголосити, що значення може мати тип, наприклад `str`, але також може бути `None`.
    
    У Python 3.6 і вище (включаючи Python 3.10) ви можете оголосити його, імпортувавши та використовуючи `Optional` з модуля `typing`.
    
    ```Python hl_lines="1  4"
    {!../../../docs_src/python_types/tutorial009.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.7K bytes
    - Viewed (0)
Back to top