r/FastAPI • u/terminalmage • Apr 24 '21
Question GET requests show Request Body in Swagger UI
Python: 3.6.8
FastAPI: 0.63.0
Pydantic: 1.8.1
Starlette: 0.13.6
I have gone through the documentation and built a multi-file app. All of my requests work fine via curl, requests, etc., but when I view them in the Swagger UI, all of the GETs have a Request Body included, which defaults to:
[
"string"
]In order to successfully send any requests via the Swagger UI, you need to first clear the Request Body text box before clicking Execute.
Is there a way to remove the Request Body from GET requests in the Swagger UI?
EDIT: This was caused by a bad type hint (see here).
1
Upvotes
1
u/Akmantainman Apr 27 '21
Can you post your route code? I don't think this is expected behavior.