# pydantic_core._pydantic_core.ValidationError: 1 validation error for Payload
name
  Input should be a valid string [type=string_type, input_value=123, input_type=int]

- **ID:** `python/pydantic-strict-str-from-int`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

model_config strict=True (or StrictStr) prevents coercion of int to str, even though v1 allowed it.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   from pydantic import BaseModel, field_validator
class Payload(BaseModel):
    model_config = {'strict': True}
    name: str
    @field_validator('name', mode='before')
    @classmethod
    def to_str(cls, v):
        return str(v)
   ```
2. **** (85% success)
   ```
   class Payload(BaseModel):
    name: int | str
    @field_validator('name')
    @classmethod
    def norm(cls, v): return str(v)
   ```

## Dead Ends

- **** — Changes semantics only for that field; other numeric-to-string coercions still fail. (40% fail)
- **** — Every caller must remember; easy to miss in one code path. (50% fail)
- **** — Disables strictness everywhere, re-introducing silent coercions you wanted to avoid. (55% fail)
