Description
While refactoring as schema I had to make use of anyOf to distinguish between a v1 of the format and v2 of it (based on presence of a version const property). This worked well with the json validator used by vscode but I observed that on python-jsonschema the error became too generic to be useful to the user.
As my schema is bit more complex, I will try to provide a minimal reproducer for the issue, hoping that we can tune it to improve the messaging.
I did create a repository with a minimal scheme that reproduce the current behavior at https://github.com/ssbarnea/rep-a
Instead of reporting the fact that "description" is not of type string, the library reports the generic message:
{'version': 1, 'description': 0}: {'version': 1, 'description': 0} is not valid under any of the given schemas
Is there any way we can write such a schema to avoid getting such a generic error?
Please note that in reality the schemas are considerably more complex, with lots of properties for each version, but if the user only gets one such top-lever error, they will never be able to spot the root cause of the issue.