-
Notifications
You must be signed in to change notification settings - Fork 37
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
Moving away from oneOf #155
base: main
Are you sure you want to change the base?
Conversation
This is quiet a large change to move away from oneOf in the schema to if/then/else. It provides much better error reporting than oneOf which prints a generic: "is not valid under any of the given schemas" without any context as it doesn't know which oneOf is closest to the one you want. This means I can get rid of all of the custom error diagnosis in I've run out of time to complete this pull request but still to do:
|
So Mike tested and unfortunately pydantic-codegen doesn't support if / then / else. But it looks like this use of if then else is what is intended: (see json schema issue: json-schema-org/json-schema-spec#31). For pydantic we can downgrade the if then else block to the following form:
to:
|
Fixes #154