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

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-05-05 00:03 +0000

1from fastapi import FastAPI 1ghaijbklcmndopeqrf

2from pydantic_settings import BaseSettings 1ghaijbklcmndopeqrf

3 

4 

5class Settings(BaseSettings): 1ghaijbklcmndopeqrf

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

7 

8 

9settings = Settings() 1ghaijbklcmndopeqrf

10 

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

12 

13 

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

15def root(): 1ghaijbklcmndopeqrf

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