From 50e886f4d646a4fad652bebbf4ef0c2c5bf0bf3e Mon Sep 17 00:00:00 2001 From: Ivan Golikov Date: Sat, 17 Dec 2022 14:33:26 +0100 Subject: [PATCH] Documentation on endpoint return data --- src/rectes/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rectes/main.py b/src/rectes/main.py index 1bc2a2a..0609776 100644 --- a/src/rectes/main.py +++ b/src/rectes/main.py @@ -11,7 +11,12 @@ class Secret(BaseModel): data: str -@app.post("/secret") +class SecretSaveResult(BaseModel): + status: str + retrieval_url: str + + +@app.post("/secret", response_model=SecretSaveResult) async def set_secret(data: Secret): new_key = await get_new_key() await redis.setex(new_key, 60 * 60 * 24, data.data)