Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. docs/ru/docs/tutorial/encoder.md

    Функция не возвращает большой `str`, содержащий данные в формате JSON (в виде строки). Она возвращает стандартную структуру данных Python (например, `dict`) со значениями и подзначениями, которые совместимы с JSON.
    
    !!! note "Технические детали"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 23 13:56:12 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  2. docs/uk/docs/tutorial/encoder.md

    Вона не повертає велику строку `str`, яка містить дані у форматі JSON (як строка). Вона повертає стандартну структуру даних Python (наприклад `dict`) із значеннями та підзначеннями, які є сумісними з JSON.
    
    !!! note "Примітка"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  3. docs_src/app_testing/app_b/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)
  4. docs/zh/docs/advanced/additional-responses.md

    			- 媒体类型的密钥,例如 `application/json` ,它包含另一个`JSON`对象作为值,该对象包含:
    				- 一个键` schema` ,它的值是来自模型的`JSON Schema`,正确的位置在这里。
    					- **FastAPI**在这里添加了对OpenAPI中另一个地方的全局JSON模式的引用,而不是直接包含它。这样,其他应用程序和客户端可以直接使用这些JSON模式,提供更好的代码生成工具等。
    
    
    **在OpenAPI中为该路径操作生成的响应将是:**
    
    ```json hl_lines="3-12"
    {
        "responses": {
            "404": {
                "description": "Additional Response",
                "content": {
                    "application/json": {
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 09 15:53:39 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py

    def test_post_no_body_q_bar(client: TestClient):
        response = client.put("/items/5?q=bar", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5, "q": "bar"}
    
    
    def test_post_no_body(client: TestClient):
        response = client.put("/items/5", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5}
    
    
    def test_post_id_foo(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial002.py

                        "type": "value_error.missing",
                    }
                ]
            }
        )
    
    
    def test_post_body_json():
        response = client.post("/files/", json={"file": "Foo"})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "files"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial002_py310.py

        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Foo", "description": None}
    
    
    @needs_py310
    def test_read_items(client: TestClient) -> None:
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {
                "name": "Portal Gun",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  8. tests/test_starlette_exception.py

        assert response.status_code == 200, response.text
        assert response.json() == {"item": "The Foo Wrestlers"}
    
    
    def test_get_item_not_found():
        response = client.get("/items/bar")
        assert response.status_code == 404, response.text
        assert response.headers.get("x-error") == "Some custom header"
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_get_starlette_item():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  9. docs/ja/docs/tutorial/schema-extra-example.md

    <img src="https://fastapi.tiangolo.com/img/tutorial/body-fields/image01.png">
    
    ## 技術詳細
    
    `example` と `examples`について...
    
    JSON Schemaの最新バージョンでは<a href="https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5" class="external-link" target="_blank">`examples`</a>というフィールドを定義していますが、OpenAPIは`examples`を持たない古いバージョンのJSON Schemaをベースにしています。
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3K bytes
    - Viewed (0)
  10. tests/test_union_inherited_body.py

    def test_post_extended_item():
        response = client.post("/items/", json={"name": "Foo", "age": 5})
        assert response.status_code == 200, response.text
        assert response.json() == {"item": {"name": "Foo", "age": 5}}
    
    
    def test_post_item():
        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 200, response.text
        assert response.json() == {"item": {"name": "Foo"}}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.2K bytes
    - Viewed (0)
Back to top