Coverage for docs_src/conditional_openapi/tutorial001.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi import FastAPI 1abcde

2from pydantic_settings import BaseSettings 1abcde

3 

4 

5class Settings(BaseSettings): 1abcde

6 openapi_url: str = "/openapi.json" 1abcde

7 

8 

9settings = Settings() 1abcde

10 

11app = FastAPI(openapi_url=settings.openapi_url) 1abcde

12 

13 

14@app.get("/") 1abcde

15def root(): 1abcde

16 return {"message": "Hello World"} 1abcde