chore: incorporate review comments

This commit is contained in:
Abhishek Kumar 2026-07-20 21:21:25 +05:30
parent e486920db2
commit fdc181e75d
11 changed files with 215 additions and 152 deletions

View file

@ -258,7 +258,10 @@ class ContextDestinationMappingConfig(BaseModel):
@field_validator("context_path")
@classmethod
def strip_context_path(cls, value: str) -> str:
return value.strip()
stripped = value.strip()
if not stripped:
raise ValueError("context path cannot be blank")
return stripped
@field_validator("fallback_destination")
@classmethod

View file

@ -22,15 +22,15 @@ class ExternalPBXFieldMapping(BaseModel):
context_path: str = Field(min_length=1, max_length=255)
destination_field: str = Field(pattern=r"^[A-Za-z][A-Za-z0-9_]{0,63}$")
@field_validator("context_path")
@field_validator("context_path", mode="before")
@classmethod
def strip_context_path(cls, value: str) -> str:
return value.strip()
def strip_context_path(cls, value: object) -> object:
return value.strip() if isinstance(value, str) else value
@field_validator("destination_field")
@field_validator("destination_field", mode="before")
@classmethod
def strip_destination_field(cls, value: str) -> str:
return value.strip()
def strip_destination_field(cls, value: object) -> object:
return value.strip() if isinstance(value, str) else value
class AmbientNoiseConfigurationDefaults(BaseModel):