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
See example code
from typing import Literal from pydantic import BaseModel type TestType0 = Literal["test1", "test2"] type TestType1 = Literal[TestType0, Literal["test3"]] type TestType2 = Literal[Literal["test1", "test2"], Literal["test3"]] # TestType1 does not work # TestType2 works class Model(BaseModel): f: TestType1 print(Model.model_json_schema())
pydantic version: 2.7.0 pydantic-core version: 2.18.1 pydantic-core build: profile=release pgo=true python version: 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)] platform: macOS-13.0.1-arm64-arm-64bit related packages: typing_extensions-4.11.0 fastapi-0.110.1 pydantic-extra-types-2.6.0 pydantic-settings-2.2.1 commit: unknown
The text was updated successfully, but these errors were encountered:
@AlexanderPodorov,
Thanks for the report. Seems like we don't fully support this syntax yet - PRs welcome with added support!
Sorry, something went wrong.
I don't think this is new as of 2.7
No branches or pull requests
Initial Checks
Description
See example code
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: