Documentation on endpoint return data

This commit is contained in:
Ivan Golikov 2022-12-17 14:33:26 +01:00
parent 3a0ae4503a
commit 50e886f4d6

View file

@ -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)