We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In pydantic 2.6.3, python 3.11.6:
Calling BaseModel.schema_json() raises AssertionError: this is a bug! please report it
BaseModel.schema_json()
AssertionError: this is a bug! please report it
>>> from pydantic import BaseModel >>> BaseModel.schema_json() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/straz/Library/Python/3.11/lib/python/site-packages/pydantic/main.py", line 1287, in schema_json cls.model_json_schema(by_alias=by_alias, ref_template=ref_template), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/straz/Library/Python/3.11/lib/python/site-packages/pydantic/main.py", line 391, in model_json_schema return model_json_schema( ^^^^^^^^^^^^^^^^^^ File "/Users/straz/Library/Python/3.11/lib/python/site-packages/pydantic/json_schema.py", line 2176, in model_json_schema assert '__pydantic_core_schema__' in cls.__dict__, 'this is a bug! please report it' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: this is a bug! please report it
% python3 -c "import pydantic.version; print(pydantic.version.version_info())" pydantic version: 2.6.3 pydantic-core version: 2.16.3 pydantic-core build: profile=release pgo=true install path: /Users/straz/Library/Python/3.11/lib/python/site-packages/pydantic python version: 3.11.6 (v3.11.6:8b6ee5ba3b, Oct 2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)] platform: macOS-14.4.1-arm64-arm-64bit related packages: fastapi-0.110.0 typing_extensions-4.9.0 commit: unknown
The text was updated successfully, but these errors were encountered:
This was raised here: #8896
And improved here: #8928 (available in 2.7).
Sorry, something went wrong.
Yep, thanks @Viicos!
No branches or pull requests
Initial Checks
Description
In pydantic 2.6.3, python 3.11.6:
Calling
BaseModel.schema_json()
raisesAssertionError: this is a bug! please report it
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: