Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 803 for json (0.17 sec)

  1. docs/fr/docs/advanced/additional-responses.md

        Le bon endroit est :
    
        * Dans la clé `content`, qui a pour valeur un autre objet JSON (`dict`) qui contient :
            * Une clé avec le type de support, par ex. `application/json`, qui contient comme valeur un autre objet JSON, qui contient :
                * Une clé `schema`, qui a pour valeur le schéma JSON du modèle, voici le bon endroit.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_body/test_tutorial001.py

            headers={"content-type": "application/json"},
            content="{some broken json}",
        )
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "json_invalid",
                        "loc": ["body", 1],
                        "msg": "JSON decode error",
                        "input": {},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (4)
  3. tests/test_tutorial/test_body/test_tutorial001_py310.py

            headers={"content-type": "application/json"},
            content="{some broken json}",
        )
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "json_invalid",
                        "loc": ["body", 1],
                        "msg": "JSON decode error",
                        "input": {},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  4. tests/test_include_router_defaults_overrides.py

        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter("always")
            response = client.get("/openapi.json")
            assert issubclass(w[-1].category, UserWarning)
            assert "Duplicate Operation ID" in str(w[-1].message)
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/override1": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
  5. tests/test_query.py

        assert response.json() == "foo bar"
    
    
    def test_query_param_query_50():
        response = client.get("/query/param?query=50")
        assert response.status_code == 200
        assert response.json() == "foo bar 50"
    
    
    def test_query_param_required():
        response = client.get("/query/param-required")
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_bigger_applications/test_main_an.py

        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_bigger_applications/test_main_an_py39.py

        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    @needs_py39
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.9K bytes
    - Viewed (0)
  8. tests/test_response_by_alias.py

        assert response.json() == {"name": "Foo"}
    
    
    def test_read_model():
        response = client.get("/model")
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Foo"}
    
    
    def test_read_list():
        response = client.get("/list")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {"name": "Foo"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  9. docs_src/app_testing/app_b_an/test_main.py

        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
        response = client.post(
            "/items/",
            headers={"X-Token": "coneofsilence"},
            json={"id": "foobar", "title": "Foo Bar", "description": "The Foo Barters"},
        )
        assert response.status_code == 200
        assert response.json() == {
            "id": "foobar",
            "title": "Foo Bar",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial005_an.py

        response = client.post("/token", data=data)
        content = response.json()
        access_token = content.get("access_token")
        return access_token
    
    
    def test_login():
        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        content = response.json()
        assert "access_token" in content
        assert content["token_type"] == "bearer"
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
Back to top