Search Options

Results per page
Sort
Preferred Languages
Advance

Results 431 - 440 of 1,387 for orjson (0.15 sec)

  1. tests/test_request_params/test_header/test_required_str.py

        ["/required-str", "/model-required-str"],
    )
    def test_required_str_missing(path: str):
        client = TestClient(app)
        response = client.get(path)
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["header", "p"],
                    "msg": "Field required",
                    "input": AnyThing,
                }
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10K bytes
    - Viewed (0)
  2. tests/test_serialize_response_model.py

    
    def test_valid():
        response = client.get("/items/valid")
        response.raise_for_status()
        assert response.json() == {"aliased_name": "valid", "price": 1.0, "owner_ids": None}
    
    
    def test_coerce():
        response = client.get("/items/coerce")
        response.raise_for_status()
        assert response.json() == {
            "aliased_name": "coerce",
            "price": 1.0,
            "owner_ids": None,
        }
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  3. tests/test_request_param_model_by_alias.py

        assert response.status_code == 200, response.text
        assert response.json() == {"param": "value"}
    
    
    def test_header_model_with_alias():
        client = TestClient(app)
        response = client.get("/header", headers={"param_alias": "value"})
        assert response.status_code == 200, response.text
        assert response.json() == {"param": "value"}
    
    
    def test_cookie_model_with_alias():
        client = TestClient(app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  4. tests/test_additional_responses_custom_model_in_callback.py

    def main_route(callback_url: HttpUrl):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == snapshot(
            {
                "openapi": "3.1.0",
                "info": {"title": "FastAPI", "version": "0.1.0"},
                "paths": {
                    "/": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_extra_models/test_tutorial001_tutorial002.py

    def test_post(client: TestClient):
        response = client.post(
            "/user/",
            json={
                "username": "johndoe",
                "password": "secret",
                "email": "******@****.***",
                "full_name": "John Doe",
            },
        )
        assert response.status_code == 200, response.text
        assert response.json() == {
            "username": "johndoe",
            "email": "******@****.***",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 5.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

        return client
    
    
    def test_endpoint_works(client: TestClient):
        response = client.post("/", json=[1, 2, 3])
        assert response.json() == 6
    
    
    def test_exception_handler_body_access(client: TestClient):
        response = client.post("/", json={"numbers": [1, 2, 3]})
        assert response.json() == {
            "detail": {
                "errors": [
                    {
                        "type": "list_type",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_openapi_webhooks/test_tutorial001.py

        assert response.status_code == 200, response.text
        assert response.json() == ["Rick", "Morty"]
    
    
    def test_dummy_webhook():
        # Just for coverage
        app.webhooks.routes[0].endpoint({})
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_authentication_error_status_code/test_tutorial001.py

        assert response.status_code == 200
        assert response.json() == {
            "message": "You are authenticated",
            "token": "secrettoken",
        }
    
    
    def test_get_me_no_credentials(client: TestClient):
        response = client.get("/me")
        assert response.status_code == 403
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_openapi_schema(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  9. cmd/batch-rotate.go

    	NewerThan     time.Duration `yaml:"newerThan,omitempty" json:"newerThan"`
    	OlderThan     time.Duration `yaml:"olderThan,omitempty" json:"olderThan"`
    	CreatedAfter  time.Time     `yaml:"createdAfter,omitempty" json:"createdAfter"`
    	CreatedBefore time.Time     `yaml:"createdBefore,omitempty" json:"createdBefore"`
    	Tags          []BatchJobKV  `yaml:"tags,omitempty" json:"tags"`
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 14.7K bytes
    - Viewed (0)
  10. tests/test_request_params/test_cookie/test_optional_str.py

        assert response.status_code == 200
        assert response.json() == {"p": None}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-str", "/model-optional-str"],
    )
    def test_optional_str(path: str):
        client = TestClient(app)
        client.cookies.set("p", "hello")
        response = client.get(path)
        assert response.status_code == 200
        assert response.json() == {"p": "hello"}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.4K bytes
    - Viewed (0)
Back to top