Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 129 for example (0.2 sec)

  1. tests/test_schema_extra_examples.py

                item: Item = Body(
                    example={"data": "Overridden example"},
                    examples=[
                        {"data": "examples example_examples 1"},
                        {"data": "examples example_examples 2"},
                    ],
                ),
            ):
                return item
    
        # TODO: enable these tests once/if Form(embed=False) is supported
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  2. fastapi/params.py

            **extra: Any,
        ):
            if example is not _Unset:
                warnings.warn(
                    "`example` has been deprecated, please use `examples` instead",
                    category=DeprecationWarning,
                    stacklevel=4,
                )
            self.example = example
            self.include_in_schema = include_in_schema
            self.openapi_examples = openapi_examples
            kwargs = dict(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  3. fastapi/param_functions.py

            strict=strict,
            multiple_of=multiple_of,
            allow_inf_nan=allow_inf_nan,
            max_digits=max_digits,
            decimal_places=decimal_places,
            example=example,
            examples=examples,
            openapi_examples=openapi_examples,
            deprecated=deprecated,
            include_in_schema=include_in_schema,
            json_schema_extra=json_schema_extra,
            **extra,
        )
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial005_an import app
    
        client = TestClient(app)
        return client
    
    
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
                "description": "A very nice Item",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 6.7K bytes
    - Viewed (0)
  5. docs_src/metadata/tutorial001_1.py

        description=description,
        summary="Deadpool's favorite app. Nuff said.",
        version="0.0.1",
        terms_of_service="http://example.com/terms/",
        contact={
            "name": "Deadpoolio the Amazing",
            "url": "http://x-force.example.com/contact/",
            "email": "dp@x-force.example.com",
        },
        license_info={
            "name": "Apache 2.0",
            "identifier": "MIT",
        },
    )
    
    
    @app.get("/items/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 767 bytes
    - Viewed (0)
  6. fastapi/security/http.py

        `HTTPDigest` in a dependency.
    
        The HTTP authorization header value is split by the first space.
    
        The first part is the `scheme`, the second part is the `credentials`.
    
        For example, in an HTTP Bearer token scheme, the client will send a header
        like:
    
        ```
        Authorization: Bearer deadbeef12346
        ```
    
        In this case:
    
        * `scheme` will have the value `"Bearer"`
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_background_tasks/test_tutorial002_an.py

        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/foo@example.com?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 571 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_background_tasks/test_tutorial002_an_py310.py

        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/foo@example.com?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 631 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_schema_extra_example/test_tutorial001_pv1.py

    from ...utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial001_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_schema_extra_example/test_tutorial004_an_py310.py

    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial004_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    # Test required and embedded body parameters with no bodies sent
    @needs_py310
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
Back to top