Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Should the test suite test validation of invalid schemas which are not invalid under the metaschema they come from #397

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

Closed
ssilverman opened this issue Jun 11, 2020 · 1 comment
Labels
needs decision An issue that requires a design decision before it can be completed

Comments

@ssilverman
Copy link
Member

ssilverman commented Jun 11, 2020

There are a number of constraints that the specification places on schemas which make them (the schemas) valid or invalid. Many or most of these constraints are specified in the draft's metaschema. As a concrete example, schemas must be objects or booleans, and the metaschema includes a type validator to ensure as such. There are however a number of constraints the draft specifications place on schemas which are not represented in a metaschema. They are directed (presumably at schema authors) as things they MUST NOT do, but no validatable entity exists which implements these constraints.

Because no such entity exists, it's not currently possible to test these constraints under the current structure of the suite.

Known examples

If the decision is made that the suite should test this behavior (e.g., because implementers should implement validation of this behavior), then a structure change may be necessary to the suite, in which case one needs to be designed in a way to reduce impact to users of the test suite.

There are a few ways to do this. Here are two:

  1. Add a new property, "isMeta" or something similar, to a test set, as a sibling to the "schema" element.
  2. Put schemas-being-tested-beyond-the-meta-schema tests into a specific directory in a draft's test suite, for example in "meta/". Then the test runner knows to handle them specially.

Both cases basically tell the test runner, "apply additional schema rules to the data instances too".

@Julian
Copy link
Member

Julian commented Jun 11, 2020

Going to modify the description, but if I change your meaning, obviously lemme know / revert.

@Julian Julian changed the title Place to discuss how to test meta-schemas Should the test suite test validation of invalid schemas which are not invalid under the metaschema they come from Jun 11, 2020
@Julian Julian added the needs decision An issue that requires a design decision before it can be completed label Jul 1, 2022
@json-schema-org json-schema-org locked and limited conversation to collaborators Aug 5, 2022
@Julian Julian converted this issue into discussion #581 Aug 5, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
needs decision An issue that requires a design decision before it can be completed
Projects
None yet
Development

No branches or pull requests

7 participants