Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  38050b74_63f1_97c6_2df6_68080f7885e9["test_openapi_schema()"]
  2eaf0434_97a7_45df_952a_09c1009bcb04["test_tutorial001.py"]
  38050b74_63f1_97c6_2df6_68080f7885e9 -->|defined in| 2eaf0434_97a7_45df_952a_09c1009bcb04
  style 38050b74_63f1_97c6_2df6_68080f7885e9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_metadata/test_tutorial001.py lines 15–52

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": "ChimichangApp",
                "summary": "Deadpool's favorite app. Nuff said.",
                "description": "\nChimichangApp API helps you do awesome stuff. 🚀\n\n## Items\n\nYou can **read items**.\n\n## Users\n\nYou will be able to:\n\n* **Create users** (_not implemented_).\n* **Read users** (_not implemented_).\n",
                "termsOfService": "http://example.com/terms/",
                "contact": {
                    "name": "Deadpoolio the Amazing",
                    "url": "http://x-force.example.com/contact/",
                    "email": "dp@x-force.example.com",
                },
                "license": {
                    "name": "Apache 2.0",
                    "url": "https://www.apache.org/licenses/LICENSE-2.0.html",
                },
                "version": "0.0.1",
            },
            "paths": {
                "/items/": {
                    "get": {
                        "summary": "Read Items",
                        "operationId": "read_items_items__get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            }
                        },
                    }
                }
            },
        }
    )

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_tutorial/test_metadata/test_tutorial001.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_tutorial/test_metadata/test_tutorial001.py at line 15.

Analyze Your Own Codebase

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

Try Supermodel Free