-
-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathsingle_file_docs.py
More file actions
48 lines (25 loc) · 853 Bytes
/
single_file_docs.py
File metadata and controls
48 lines (25 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from fastapi import FastAPI
no_openapi = FastAPI(openapi_url=None)
@no_openapi.get("/")
def no_openapi_root():
return {"message": "single file no_openapi"}
none_docs = FastAPI(docs_url=None, redoc_url=None)
@none_docs.get("/")
def none_docs_root():
return {"message": "single file none_docs"}
no_docs = FastAPI(docs_url=None)
@no_docs.get("/")
def no_docs_root():
return {"message": "single file no_docs"}
no_redoc = FastAPI(redoc_url=None)
@no_redoc.get("/")
def no_redoc_root():
return {"message": "single file no_redoc"}
full_docs = FastAPI()
@full_docs.get("/")
def full_docs_root():
return {"message": "single file full_docs"}
custom_docs = FastAPI(docs_url="/custom-docs-url", redoc_url="/custom-redoc-url")
@custom_docs.get("/")
def custom_docs_root():
return {"message": "single file custom_docs"}