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

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

## Root Cause

A string value containing a decimal or non-numeric characters was passed to an int-typed field. Pydantic v2 strict parsing rejects strings like '19.99' for int fields.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   from decimal import Decimal
from pydantic import BaseModel

class Product(BaseModel):
    price: Decimal
   ```
2. **** (90% success)
   ```
   from pydantic import BaseModel, field_validator

class Product(BaseModel):
    price: int

    @field_validator('price', mode='before')
    @classmethod
    def parse_price(cls, v):
        return int(float(v))
   ```

## Dead Ends

- **** — int('19.99') raises ValueError because Python cannot directly cast a decimal string to int. (90% fail)
- **** — Loses numeric semantics; downstream arithmetic operations will fail with TypeError. (60% fail)
