# pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'decimal.Decimal'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

- **ID:** `python/pydantic-arbitrary-types-schema`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A field uses a type (custom class, Decimal subclass, numpy dtype) that has no built-in pydantic-core schema.

## Version Compatibility

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

## Workarounds

1. **** (88% success)
   ```
   from pydantic import BaseModel, ConfigDict
class M(BaseModel):
    model_config = ConfigDict(arbitrary_types_allowed=True)
    amount: Decimal
   ```
2. **** (82% success)
   ```
   from typing import Annotated
from pydantic import BaseModel, PlainSerializer
from decimal import Decimal
Amt = Annotated[Decimal, PlainSerializer(lambda d: str(d), return_type=str)]
class M(BaseModel):
    amount: Amt
   ```

## Dead Ends

- **** — Disables validation and serialization; JSON schema loses type info. (50% fail)
- **** — Loses type guarantees; callers must re-parse everywhere. (60% fail)
- **** — Breaks all other models and is not supported across pydantic minor versions. (75% fail)
