-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly describe the serialization format in the JSON schema #37
Comments
Here's a reproducible example: >>> from pydantic.type_adapter import TypeAdapter
>>> from pydantic_numpy.typing import Np1DArrayFp64
>>> TypeAdapter(Np1DArrayFp64).json_schema()
{'strict_data_typing': False, 'type': 'np.ndarray[tuple[int], np.dtype[float64]'} |
Are you open to a PR fixing this? Because it's moderately important to my use case. |
I will fix it, but it will have to wait till April. Welcome to make a PR if you can't wait in the meantime. |
Fixed with #41 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, an
Np1DArrayFp64
will generate a JSON schema with the following type:This is incorrect, as I don't think it's a valid JSON schema type at all. What it should return is the JSON schema describing a
NumpyDataDict
, which is already in the repo:pydantic-numpy/pydantic_numpy/helper/typing.py
Lines 7 to 9 in 438b18c
The text was updated successfully, but these errors were encountered: