Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 723 for json (0.14 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py

                    }
                ]
            }
        )
    
    
    @needs_py39
    def test_post_body_json(client: TestClient):
        response = client.post("/files/", json={"file": "Foo"})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_files/test_tutorial002_py39.py

                    }
                ]
            }
        )
    
    
    @needs_py39
    def test_post_body_json(client: TestClient):
        response = client.post("/files/", json={"file": "Foo"})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/schema-extra-example.md

    使用上面的任何方法,它在 `/docs` 中看起来都是这样的:
    
    <img src="/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 基于之前的一个旧版JSON Schema,并没有 `examples`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_body_fields/test_tutorial001.py

        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None},
        }
    
    
    def test_items_6(client: TestClient):
        response = client.put(
            "/items/6",
            json={
                "item": {
                    "name": "Bar",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_body_fields/test_tutorial001_py310.py

        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None},
        }
    
    
    @needs_py310
    def test_items_6(client: TestClient):
        response = client.put(
            "/items/6",
            json={
                "item": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py

                    },
                ]
            }
        )
    
    
    @needs_py39
    def test_post_body_json(client: TestClient):
        response = client.post("/login/", json={"username": "Foo", "password": "secret"})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  7. istioctl/pkg/admin/istiodconfig.go

    		outputFormat: outputFormat,
    	}}
    }
    
    type ScopeInfo struct {
    	Name            string `json:"name"`
    	Description     string `json:"description,omitempty"`
    	OutputLevel     string `json:"output_level,omitempty"`
    	StackTraceLevel string `json:"stack_trace_level,omitempty"`
    	LogCallers      bool   `json:"log_callers,omitempty"`
    }
    
    type ScopeLevelPair struct {
    	scope    string
    	logLevel string
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/path-operation-advanced-configuration.md

    And you could do this even if the data type in the request is not JSON.
    
    For example, in this application we don't use FastAPI's integrated functionality to extract the JSON Schema from Pydantic models nor the automatic validation for JSON. In fact, we are declaring the request content type as YAML, not JSON:
    
    === "Pydantic v2"
    
        ```Python hl_lines="17-22  24"
    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)
  9. cmd/site-replication-metrics.go

    type SRMetric struct {
    	DeploymentID  string             `json:"deploymentID"`
    	Endpoint      string             `json:"endpoint"`
    	TotalDowntime time.Duration      `json:"totalDowntime"`
    	LastOnline    time.Time          `json:"lastOnline"`
    	Online        bool               `json:"isOnline"`
    	Latency       madmin.LatencyStat `json:"latency"`
    
    	// replication metrics across buckets roll up
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Feb 06 06:00:45 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/handling-errors.md

    Если клиент запросит `http://example.com/items/foo` (`item_id` `"foo"`), то он получит статус-код 200 и ответ в формате JSON:
    
    ```JSON
    {
      "item": "The Foo Wrestlers"
    }
    ```
    
    Но если клиент запросит `http://example.com/items/bar` (несуществующий `item_id` `"bar"`), то он получит статус-код 404 (ошибка "не найдено") и JSON-ответ в виде:
    
    ```JSON
    {
      "detail": "Item not found"
    }
    ```
    
    !!! tip "Подсказка"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.5K bytes
    - Viewed (0)
Back to top