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