Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for Frick (0.16 sec)

  1. docs/en/docs/advanced/dataclasses.md

    !!! info
        Keep in mind that dataclasses can't do everything Pydantic models can do.
    
        So, you might still need to use Pydantic models.
    
        But if you have a bunch of dataclasses laying around, this is a nice trick to use them to power a web API using FastAPI. 🤓
    
    ## Dataclasses in `response_model`
    
    You can also use `dataclasses` in the `response_model` parameter:
    
    ```Python hl_lines="1  7-13  19"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/settings.md

        end
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Rick")
            function ->> execute: execute function code
            execute ->> code: return the result
        end
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Rick", salutation="Mr.")
            function ->> execute: execute function code
            execute ->> code: return the result
        end
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_dependencies/test_tutorial012_an.py

                "X-Token": "fake-super-secret-token",
                "X-Key": "fake-super-secret-key",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == [{"username": "Rick"}, {"username": "Morty"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/dataclasses.md

        Daher müssen Sie möglicherweise weiterhin Pydantic-Modelle verwenden.
    
        Wenn Sie jedoch eine Menge Datenklassen herumliegen haben, ist dies ein guter Trick, um sie für eine Web-API mithilfe von FastAPI zu verwenden. 🤓
    
    ## Datenklassen als `response_model`
    
    Sie können `dataclasses` auch im Parameter `response_model` verwenden:
    
    ```Python hl_lines="1  7-13  19"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:18:23 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  5. docs/de/docs/advanced/settings.md

        end
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Rick")
            function ->> execute: führe Code der Funktion aus
            execute ->> code: gib das Resultat zurück
        end
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Rick", salutation="Mr.")
            function ->> execute: führe Code der Funktion aus
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:17:14 GMT 2024
    - 17.8K bytes
    - Viewed (0)
  6. docs/de/docs/tutorial/query-params-str-validations.md

    ```Python
    q: Annotated[str, Query(default="rick")] = "morty"
    ```
    
    ... denn es wird nicht klar, ob der Defaultwert `"rick"` oder `"morty"` sein soll.
    
    Sie würden also (bevorzugt) schreiben:
    
    ```Python
    q: Annotated[str, Query()] = "rick"
    ```
    
    In älterem Code werden Sie auch finden:
    
    ```Python
    q: str = Query(default="rick")
    ```
    
    ### Vorzüge von `Annotated`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 17:58:59 GMT 2024
    - 27.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py

                "X-Token": "fake-super-secret-token",
                "X-Key": "fake-super-secret-key",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == [{"username": "Rick"}, {"username": "Morty"}]
    
    
    @needs_py39
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial012.py

                "X-Token": "fake-super-secret-token",
                "X-Key": "fake-super-secret-key",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == [{"username": "Rick"}, {"username": "Morty"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/path-operation-advanced-configuration.md

    Nevertheless, we can declare the expected schema for the request body.
    
    ### Custom OpenAPI content type
    
    Using this same trick, you could use a Pydantic model to define the JSON Schema that is then included in the custom OpenAPI schema section for the *path operation*.
    
    And you could do this even if the data type in the request is not JSON.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  10. docs/de/docs/advanced/path-operation-advanced-configuration.md

    Dennoch können wir das zu erwartende Schema für den Requestbody deklarieren.
    
    ### Benutzerdefinierter OpenAPI-Content-Type
    
    Mit demselben Trick könnten Sie ein Pydantic-Modell verwenden, um das JSON-Schema zu definieren, das dann im benutzerdefinierten Abschnitt des OpenAPI-Schemas für die *Pfadoperation* enthalten ist.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:27:23 GMT 2024
    - 8.5K bytes
    - Viewed (0)
Back to top