Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for validateId (0.05 sec)

  1. tests/test_tutorial/test_security/test_tutorial005.py

        client = TestClient(mod.app)
        response = client.get("/users/me", headers={"Authorization": "Bearer nonexistent"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Could not validate credentials"}
        assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
    
    
    def test_incorrect_token_type(mod: ModuleType):
        client = TestClient(mod.app)
        response = client.get(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  2. pyproject.toml

    standard = [
        "fastapi-cli[standard] >=0.0.8",
        # For the test client
        "httpx >=0.23.0,<1.0.0",
        # For templates
        "jinja2 >=3.1.5",
        # For forms and file uploads
        "python-multipart >=0.0.18",
        # To validate email fields
        "email-validator >=2.0.0",
        # Uvicorn with uvloop
        "uvicorn[standard] >=0.12.0",
        # # Settings management
        "pydantic-settings >=2.0.0",
        # # Extra Pydantic data types
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  3. fastapi/openapi/models.py

    except ImportError:  # pragma: no cover
    
        class EmailStr(str):  # type: ignore
            @classmethod
            def __get_validators__(cls) -> Iterable[Callable[..., Any]]:
                yield cls.validate
    
            @classmethod
            def validate(cls, v: Any) -> str:
                logger.warning(
                    "email-validator not installed, email fields will be treated as str.\n"
                    "To install, run: pip install email-validator"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  4. fastapi/dependencies/utils.py

        if value is None:
            if field.required:
                return None, [get_missing_field_error(loc=loc)]
            else:
                return deepcopy(field.default), []
        v_, errors_ = field.validate(value, values, loc=loc)
        if isinstance(errors_, list):
            new_errors = _regenerate_error_with_loc(errors=errors_, loc_prefix=())
            return None, new_errors
        else:
            return v_, []
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  5. fastapi/_compat/v2.py

                )
    
        def get_default(self) -> Any:
            if self.field_info.is_required():
                return Undefined
            return self.field_info.get_default(call_default_factory=True)
    
        def validate(
            self,
            value: Any,
            values: dict[str, Any] = {},  # noqa: B006
            *,
            loc: tuple[Union[int, str], ...] = (),
        ) -> tuple[Any, Union[list[dict[str, Any]], None]]:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  6. fastapi/routing.py

    ) -> Any:
        if field:
            errors = []
            if is_coroutine:
                value, errors_ = field.validate(response_content, {}, loc=("response",))
            else:
                value, errors_ = await run_in_threadpool(
                    field.validate, response_content, {}, loc=("response",)
                )
            if isinstance(errors_, list):
                errors.extend(errors_)
            if errors:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 174.6K bytes
    - Viewed (0)
  7. docs/en/docs/release-notes.md

    app = FastAPI()
    
    @app.get("/items/invalidnone", response_model=Union[Item, None])
    def get_invalid_none():
        return None
    ```
    
    This way the data will be correctly validated, you won't have an internal server error, and the documentation will also reflect that this *path operation* could return `None` (or `null` in JSON).
    
    ### Fixes
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:06:15 UTC 2025
    - 586.7K bytes
    - Viewed (0)
Back to top