# pydantic_core._pydantic_core.ValidationError: 1 validation error for Product
price
  Input should be a valid string [type=string_type, input_value=19.99, input_type=float]

- **ID:** `python/pydantic-v2-string-type-coercion-strict`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The model was configured with strict=True (or the field uses StrictStr), so Pydantic v2 refuses to coerce a float into a string even though lax mode would accept it.

## Version Compatibility

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

## Workarounds

1. **** (93% success)
   ```
   Add a field_validator with mode='before' to coerce: `@field_validator('price', mode='before') @classmethod def coerce(cls, v): return str(v)`
   ```
2. **** (90% success)
   ```
   Relax strictness per-field: `price: str = Field(strict=False)` while keeping the model strict.
   ```

## Dead Ends

- **** — Pushes type-handling logic to every call site; easy to miss one and re-trigger the error (60% fail)
- **** — Disables strictness everywhere, silently accepting bad data for unrelated fields (70% fail)
