-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Make evaluation with/against language consistent. #922
Comments
"evaluation" is more broad. Validation is just one of the things that happen when an instance is evaluated against a schema. Other things can also happen (notably annotation collection, when validation succeeds); also, when validation fails, we don't just get a false result back, but also a collection of errors. In my in-progress implementation I chose to name the primary API entry point "evaluate", not "validate", because of this. :) |
@karenetheridge yeah, the inconsistent terminology is partially due to everything originally being expressed in terms of validation. |
"evaluate" would be in line with application of schema to instance where validation isn't the primary concern. |
I'm happy to consider this change with the next release, but I'd also like to consider this in conjunction with supporting other use cases that don't necessarily need an instance. With that in mind, it makes sense to "evaluate" a schema, and the context of that evaluation (validation, code gen, etc.) implies whether an instance is involved. Validation requires an instance, so the schema is evaluated against the instance; code gen doesn't require one, so the schema is merely evaluated. |
I personally like this a lot and I think matches how I've been thinking about it: any operation involving at least a schema is considered evaluation. Validation is one type of evaluation that also necessitates an instance. |
We should be consistent when talking about evaluating a schema and an instance together. This is sometimes discussed as being "runtime", which I think is fairly clear although maybe should be called out in the intro material.
Otherwise, I often use "evaluate against" or "validate against", but whether it's "schema evaluated against an instance' or "instance validated against a schema", etc. is pretty random. It probably roughly correlates with whether I was primarily talking about the instance or schema, but maybe not even that.
@ssilverman this is one of several wording issues that could use a meticulous eye. And for that matter, an answer to the question of why it goes one way or the other, even if that's just "we flipped a coin and decided it works this way."
From a user perspective, you're using the schema to evaluate / validate the instance. So the instance is or is not valid (evaluated?) against the schema.
Within the spec, we talk about loading schemas (load time) and evaluating them with/against an instance (runtime). This is more about the implementation process of doing the things the schema keywords indicate.
It's a bit of a vague mess with different bits written from different perspectives, and it's been low-level bugging me for a while.
The text was updated successfully, but these errors were encountered: