Serializing multiple phone numbers raises AttributeError
Author: aimansourCreated Sep 18, 2026Updated Sep 18, 2026
Problem
cv.phone accepts either one phone number or a list, but serializing a validated list crashes because Cv.serialize_phone calls .replace() on the list itself.
Reproduction
from rendercv.schema.models.cv.cv import Cv
cv = Cv.model_validate({
"name": "Test",
"phone": ["+14155552671", "+442071838750"],
})
cv.model_dump()Current result:
pydantic_core.PydanticSerializationError: Error calling function `serialize_phone`:
AttributeError: 'list' object has no attribute 'replace'This also affects the AI skill because its generated schema advertises multiple phone numbers as supported.
Expected behavior
Serialization should remove the tel: prefix from each validated phone number while preserving scalar and None behavior.
Suggested fix
Handle scalar and list values separately in the serializer and add regression coverage for both shapes.
Source: rendercv/rendercv