Skip to content
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

OneOfNotValid having uninformative description? #429

Closed
iliya-malecki opened this issue Jun 7, 2023 · 0 comments
Closed

OneOfNotValid having uninformative description? #429

iliya-malecki opened this issue Jun 7, 2023 · 0 comments

Comments

@iliya-malecki
Copy link
Contributor

iliya-malecki commented Jun 7, 2023

I might not understand the point of "oneOf", but if it means "this field must work under one of the following schemas", then would it be very helpful to actually name the field the properties of which must follow the schemas. I bumped into this problem when a toml validator extension that uses this crate in its source code produced this unhelpful error validating a pyproject.toml:
image

What seems to be happening is that "project" has a "oneOf" in it, which requires either "version" or "dynamic" field.
Hence, i think it would be helpful to have, instead of

{"name":"hello"} is not valid under any of the given schemas

something among the lines of

{"name":"hello"} is not valid under any of the schemas given in the "oneOf" option list

In case you think it is obvious that "any of the given schemas" refers specifically to "oneOf", i'm happy to inform that there is a half a year old issue about this error message :)

just for the sake of reproducibility, the full pyproject.toml im referring to looks like this:

[project]
name = 'hello'
# version = "2.0.0"v # commented out to show the point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant