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

Make evaluation with/against language consistent. #922

Open
handrews opened this issue May 15, 2020 · 5 comments
Open

Make evaluation with/against language consistent. #922

handrews opened this issue May 15, 2020 · 5 comments
Labels
clarification Items that need to be clarified in the specification Priority: Low

Comments

@handrews
Copy link
Contributor

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.

@karenetheridge
Copy link
Member

"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. :)

@handrews
Copy link
Contributor Author

@karenetheridge yeah, the inconsistent terminology is partially due to everything originally being expressed in terms of validation.

@Relequestual
Copy link
Member

"evaluate" would be in line with application of schema to instance where validation isn't the primary concern.
I think that's a sort of consensus and enough to enable someone to make a PR for this (or at least part of one as a draft).

@gregsdennis
Copy link
Member

gregsdennis commented Jun 18, 2024

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.

@jviotti
Copy link
Member

jviotti commented Jun 20, 2024

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.

@gregsdennis gregsdennis added clarification Items that need to be clarified in the specification and removed Status: Consensus labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification Priority: Low
Projects
Status: In Discussion
Development

No branches or pull requests

5 participants