I am trying to have my FastAPI accept a string as body. Note that this string is not a JSON. For me it is important that the body argument can also be specified in the SwaggerUI that FastAPI provides. At the moment, I am doing the following:
@app.put("items/{item_name}")
async def put(item_name: str, body: str = Body(..., media_type="text/plain")):
print(body)
But it gives me an error: Error: Unprocessable Entity