Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

Architecture documentation for the test_openapi_schema() function in test_reponse_set_reponse_code_empty.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  938cde24_7cf0_8d16_9f57_5eb1bf75accb["test_openapi_schema()"]
  bfcad622_3c0f_6dca_8ab5_75c98eaa5f13["test_reponse_set_reponse_code_empty.py"]
  938cde24_7cf0_8d16_9f57_5eb1bf75accb -->|defined in| bfcad622_3c0f_6dca_8ab5_75c98eaa5f13
  style 938cde24_7cf0_8d16_9f57_5eb1bf75accb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_reponse_set_reponse_code_empty.py lines 32–104

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": {
                "/{id}": {
                    "delete": {
                        "summary": "Delete Deployment",
                        "operationId": "delete_deployment__id__delete",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Id", "type": "integer"},
                                "name": "id",
                                "in": "path",
                            }
                        ],
                        "responses": {
                            "204": {"description": "Successful Response"},
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                            },
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "HTTPValidationError": {
                        "title": "HTTPValidationError",
                        "type": "object",
                        "properties": {
                            "detail": {
                                "title": "Detail",
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/ValidationError"
                                },
                            }
                        },
                    },
                    "ValidationError": {
                        "title": "ValidationError",
                        "required": ["loc", "msg", "type"],
                        "type": "object",
                        "properties": {
                            "loc": {
                                "title": "Location",
                                "type": "array",
                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                            "input": {"title": "Input"},
                            "ctx": {"title": "Context", "type": "object"},
                        },
                    },
                }
            },
        }
    )

Domain

Subdomains

Frequently Asked Questions

What does test_openapi_schema() do?
test_openapi_schema() is a function in the fastapi codebase, defined in tests/test_reponse_set_reponse_code_empty.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_reponse_set_reponse_code_empty.py at line 32.

Analyze Your Own Codebase

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

Try Supermodel Free