mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-24 18:57:45 -05:00
📝 Update docs, compare enums with identity instead of equality (#4905)
This commit is contained in:
@@ -14,7 +14,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/models/{model_name}")
|
||||
async def get_model(model_name: ModelName):
|
||||
if model_name == ModelName.alexnet:
|
||||
if model_name is ModelName.alexnet:
|
||||
return {"model_name": model_name, "message": "Deep Learning FTW!"}
|
||||
|
||||
if model_name.value == "lenet":
|
||||
|
||||
Reference in New Issue
Block a user