# pydantic_core._pydantic_core.ValidationError: 1 validation error for User
age
  Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='abc', input_type=str]

- **ID:** `python/pydantic-validation-error-model-type`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Pydantic v2 strict-by-default coercion fails when a string like 'abc' is passed to an int field; the type coercion cannot parse non-numeric strings.

## Version Compatibility

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

## Workarounds

1. **** (92% success)
   ```
   from pydantic import BaseModel, field_validator
class User(BaseModel):
    age: int
    @field_validator('age', mode='before')
    @classmethod
    def parse_age(cls, v):
        if isinstance(v, str) and not v.isdigit():
            raise ValueError('age must be numeric')
        return int(v)
   ```
2. **** (95% success)
   ```
   from pydantic import ValidationError
try:
    User(age='abc')
except ValidationError as e:
    return {'errors': e.errors()}, 422
   ```

## Dead Ends

- **** — strict=False still refuses to parse 'abc' into int because no valid numeric representation exists. (75% fail)
- **** — This hides the error but downstream code expecting int will crash with TypeError. (60% fail)
