FastAPI has two documentations:

  • by swagger-ui (yourfastapiurl:port/docs)
  • by redoc (yourfastapiurl:port/redoc)
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"result": "It's working"}

@app.get("/ise/{mac_address}")
async def ise_search_mac_address(mac_address):
    return {"Search MAC": mac_address}

@app.get("/{mode}/ise")
async def ise_mode(mode):
    if mode == 'dev':
        return {'result': "Working with Dev ISE"}
    
    return {'result': "Working with Prod ISE"}

http://127.0.0.1:8089/docs/

Also you can try it right there:


http://127.0.0.1:8089/redoc/

And for sure, great FastAPI Documentation itself: here