# pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'numpy.ndarray'>. 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-type-not-allowed`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A field uses a third-party class that Pydantic does not know how to validate. Pydantic v2 requires either arbitrary_types_allowed or a custom core schema for unknown types.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   from pydantic import BaseModel, ConfigDict
import numpy as np

class Model(BaseModel):
    model_config = ConfigDict(arbitrary_types_allowed=True)
    arr: np.ndarray
   ```
2. **** (88% success)
   ```
   from pydantic import field_serializer

class Model(BaseModel):
    arr: np.ndarray

    @field_serializer('arr')
    def ser(self, v):
        return v.tolist()
   ```

## Dead Ends

- **** — Pydantic still cannot build a schema for it; the error reappears at class definition or import time. (85% fail)
- **** — Disables all validation and serialization for that field, losing type safety and JSON output. (60% fail)
