# pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.IsInstanceSchema (<class 'decimal.Decimal'>)

- **ID:** `python/pydantic-json-schema-generation-error`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A field uses an arbitrary Python type (via arbitrary_types_allowed or a custom class) that has no defined JSON Schema representation, so model_json_schema() fails.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   from typing import Annotated
from pydantic import BaseModel, WithJsonSchema

class Model(BaseModel):
    amount: Annotated[Decimal, WithJsonSchema({'type': 'string', 'format': 'decimal'})]
   ```
2. **** (88% success)
   ```
   class Model(BaseModel):
    amount: float  # or str; convert to Decimal in business logic
   ```

## Dead Ends

- **** — Returns an empty schema, breaking OpenAPI docs and client generation downstream. (70% fail)
- **** — This allows the type at validation time but does not teach Pydantic how to serialize it to JSON Schema. (80% fail)
