Skip to content

Commit 94b3f9f

Browse files
committed
Fix #17
1 parent 73138ab commit 94b3f9f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

db/schemas.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic import BaseModel
1+
from pydantic import BaseModel, field_validator
22
from typing import Optional, Any, Literal
33
from api_config import ACCEPTED_LANGUAGES
44

@@ -17,3 +17,9 @@ class TranslateRequest(BaseModel):
1717
class TranslateResponse(BaseModel):
1818
item_id: Optional[Any] = None
1919
item_name: Optional[Any] = None
20+
21+
@field_validator("item_name", mode="before")
22+
def process_item_name(cls, value):
23+
if value is not None and isinstance(value, str):
24+
return value.replace("\\'", "'")
25+
return value

0 commit comments

Comments
 (0)