404 Error with OpenAPI #8992
-
Hi all, New to fastAPI, and coming from Flask, I'm very impressed by the solution. I'm using v0.63.0, on an ubuntu server (18.04) Thanks a lot for your support. |
Beta Was this translation helpful? Give feedback.
Replies: 28 comments 1 reply
-
Hi, Welcome to FastAPI please follow the Issue instruction. |
Beta Was this translation helpful? Give feedback.
-
Hi, OK, here is what I can add : It seems this issue appeared when I've implemented the following code (but not sure...) : class device_import(BaseModel):
hostname: str
ipaddress: str
platform: str
description: Optional[str] = None
......
@app.post("/system/device", summary="Create a new device in the system", tags=["System"])
async def post_device(device_info: device_import):
........ All other routes are using basic structure, with path parameters or Query. In terms of imports : from typing import Optional, Dict
from fastapi import FastAPI, Request, APIRouter, Form, Query, Body
from pydantic import BaseModel, Field This issue appears each time I'm expanding a resource/API in the doc UI (Swagger UI). As explained, the engine works, and I can launch every request, but I get this error, and I really don't what could be the root cause... Thanks again, |
Beta Was this translation helpful? Give feedback.
-
your route is ......
@app.post("/system/device", summary="Create a new device in the system", tags=["System"])
async def post_device(device_info: device_import):
........ but your log is about from fastapi import Depends
@app.get("/system/device", summary="Create a new device in the system", tags=["System"])
async def post_device(device_info: device_import=Depends()):
return device_info |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I also get the samme INFO message in my log
|
Beta Was this translation helpful? Give feedback.
-
I'm having an identical issue to legalla - INFO: 127.0.0.1:58176 - "GET /%5Bobject%20Module%5D HTTP/1.1" 404 Not Found |
Beta Was this translation helpful? Give feedback.
-
I'm also running into the same issue, raised whenever I expand on an endpoint within the Swagger UI. |
Beta Was this translation helpful? Give feedback.
-
It's easy to reproduce - I have just cloned a git example repo using fast api, it seems to happen on any fast api - when clicking the swagger ui expander. https://developer.mongodb.com/how-to/FARM-Stack-FastAPI-React-MongoDB |
Beta Was this translation helpful? Give feedback.
-
Same here. |
Beta Was this translation helpful? Give feedback.
-
Same story from swagger-ui as last time #1762 ? I've got the 404 error with swagger-ui-dist@3.39, so I'll just rollback to swagger-ui-dist@3.38 for now. |
Beta Was this translation helpful? Give feedback.
-
Is there a problem with swagger-ui-dist@3.38?if no problem, can you please tell me how to rollback this version, thank you. |
Beta Was this translation helpful? Give feedback.
-
The same thing. Besides when I run my app on localhost it works perfectly. When I run the app from docker container and try to connect to server, running on localhost, I see this error. |
Beta Was this translation helpful? Give feedback.
-
I am having the same error, I think this is just an stetic issue, right?, I am not having any operational issue yet, can you confirm if this could become a pain? |
Beta Was this translation helpful? Give feedback.
-
Created a pull request with a temporary fix to this (#2656). |
Beta Was this translation helpful? Give feedback.
-
@emir-mx It's only a docs issue, not a operational issue from any of your code. |
Beta Was this translation helpful? Give feedback.
-
Great, It works for me! Thank you |
Beta Was this translation helpful? Give feedback.
-
Nice thanks @Gatux |
Beta Was this translation helpful? Give feedback.
-
The by @ArcLightSlavik mentioned temp fix works perfectly.. |
Beta Was this translation helpful? Give feedback.
-
Hi, I started having the same
This INFO logger message is triggered the first time I click on any of the FastAPI Swagger UI buttons in API I'm also using FastAPI v0.63.0 and yes @ArcLightSlavik temp fix works fine. |
Beta Was this translation helpful? Give feedback.
-
@athanhat I'm facing the same issue. Any updates on that? |
Beta Was this translation helpful? Give feedback.
-
#metoo |
Beta Was this translation helpful? Give feedback.
-
#same |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue. In NestJs Swagger UI |
Beta Was this translation helpful? Give feedback.
-
I'm seeing this as well in Swashbuckle.AspNetcore version 6.0.0. I've opened domaindrivendev/Swashbuckle.AspNetCore#1993 to try to get more information on the root cause, I know it's only tangentially related but I'm linking here for the sake of anyone else googling this issue. |
Beta Was this translation helpful? Give feedback.
-
@legalla This was fixed by swagger-ui, could you close the issue? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Why am I getting this "INFO: 127.0.0.1:51291 - "GET /v1/models HTTP/1.1" 404 Not Found - in Fastapi : in my code there so such endpoint |
Beta Was this translation helpful? Give feedback.
@legalla This was fixed by swagger-ui, could you close the issue?