Documentation on endpoint return data
This commit is contained in:
		
							parent
							
								
									3a0ae4503a
								
							
						
					
					
						commit
						50e886f4d6
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -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) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue