快速API版本 Fastapi Web应用程序的api版本控制 安装 pip install fastapi-versioning 例子 from fastapi import FastAPI from fastapi_versioning import VersionedFastAPI , version app = FastAPI ( title = "My App" ) @ app . get ( "/" ) @ version ( 1 , 0 ) def greet_with_hello (): return "Hello" @ app . get ( "/" ) @ ver