Home / Function/ test_openapi_schema_pv2() — fastapi Function Reference

test_openapi_schema_pv2() — fastapi Function Reference

Architecture documentation for the test_openapi_schema_pv2() function in test_tutorial001.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  8bbda54f_9aa3_96b6_156b_209fcc7e8aae["test_openapi_schema_pv2()"]
  7ee474b2_6f90_e0fd_eeba_305ac1b53e30["test_tutorial001.py"]
  8bbda54f_9aa3_96b6_156b_209fcc7e8aae -->|defined in| 7ee474b2_6f90_e0fd_eeba_305ac1b53e30
  style 8bbda54f_9aa3_96b6_156b_209fcc7e8aae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_response_directly/test_tutorial001.py lines 41–157

def test_openapi_schema_pv2(client: TestClient):
    response = client.get("/openapi.json")
    assert response.status_code == 200, response.text
    assert response.json() == snapshot(
        {
            "info": {
                "title": "FastAPI",
                "version": "0.1.0",
            },
            "openapi": "3.1.0",
            "paths": {
                "/items/{id}": {
                    "put": {
                        "operationId": "update_item_items__id__put",
                        "parameters": [
                            {
                                "in": "path",
                                "name": "id",
                                "required": True,
                                "schema": {"title": "Id", "type": "string"},
                            },
                        ],
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {
                                        "$ref": "#/components/schemas/Item",
                                    },
                                },
                            },
                            "required": True,
                        },
                        "responses": {
                            "200": {
                                "content": {
                                    "application/json": {"schema": {}},
                                },
                                "description": "Successful Response",
                            },
                            "422": {
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError",
                                        },
                                    },
                                },
                                "description": "Validation Error",
                            },
                        },
                        "summary": "Update Item",
                    },
                },
            },
            "components": {
                "schemas": {
                    "HTTPValidationError": {
                        "properties": {
                            "detail": {
                                "items": {
                                    "$ref": "#/components/schemas/ValidationError",
                                },
                                "title": "Detail",
                                "type": "array",
                            },
                        },
                        "title": "HTTPValidationError",
                        "type": "object",
                    },
                    "Item": {
                        "properties": {
                            "description": {
                                "anyOf": [
                                    {"type": "string"},
                                    {"type": "null"},
                                ],
                                "title": "Description",
                            },
                            "timestamp": {
                                "format": "date-time",
                                "title": "Timestamp",

Domain

Subdomains

Frequently Asked Questions

What does test_openapi_schema_pv2() do?
test_openapi_schema_pv2() is a function in the fastapi codebase, defined in tests/test_tutorial/test_response_directly/test_tutorial001.py.
Where is test_openapi_schema_pv2() defined?
test_openapi_schema_pv2() is defined in tests/test_tutorial/test_response_directly/test_tutorial001.py at line 41.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free