# pydantic_core._pydantic_core.ValidationError: 1 validation error for Account
username
  String should have at least 3 characters [type=string_too_short, input_value='ab', input_type=str]

- **ID:** `python/pydantic-validation-error-string-too-short`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A string field has a min_length constraint and the provided value is shorter than required.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   from pydantic import BaseModel, Field

class Account(BaseModel):
    username: str = Field(min_length=3)

# caller side
try:
    Account(username='ab')
except ValidationError as e:
    print(e.errors())
   ```
2. **** (85% success)
   ```
   username: str = Field(min_length=2)
   ```

## Dead Ends

- **** — Leading/trailing spaces may pass length checks but produce invalid usernames and break downstream uniqueness checks. (75% fail)
- **** — Weakens data integrity; empty or one-character usernames may break UI or DB constraints. (60% fail)
