Update code in endpoints/post-endpoint.post.py
This commit is contained in:
parent
e5a3a2aa6f
commit
902e1e8244
@ -0,0 +1,27 @@
|
|||||||
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
|
from core.database import fake_users_db
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
class WordInput(BaseModel):
|
||||||
|
word: str
|
||||||
|
|
||||||
|
@router.post("/post-endpoint")
|
||||||
|
async def append_car_handler(
|
||||||
|
input_data: WordInput
|
||||||
|
):
|
||||||
|
"""Append 'car' to input word"""
|
||||||
|
result = f"{input_data.word}car"
|
||||||
|
|
||||||
|
return {
|
||||||
|
"message": "Word processed successfully",
|
||||||
|
"data": {
|
||||||
|
"original_word": input_data.word,
|
||||||
|
"modified_word": result
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"operation": "append",
|
||||||
|
"append_value": "car"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user