Skip to content

Validation for interdependent properties #10

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

Open
manoj-pillay-10gen opened this issue Apr 6, 2023 · 1 comment
Open

Validation for interdependent properties #10

manoj-pillay-10gen opened this issue Apr 6, 2023 · 1 comment

Comments

@manoj-pillay-10gen
Copy link
Owner

An example of very commonly seen business logic for property value validation is based on dependencies of one property on another. For example, here is the definition for an edgeGram tokenizer

      "tokenizer": {
        "type": "edgeGram",
        "minGram": 5,
        "maxGram": 10
      }

An expectation is that minGram <= maxGram. However, this rule is currently not possible to install directly using the schema, because there is no way to do this in JSON schema specification

We will need to install this rule during the validation phase (no squiggly red lines) of the index before it gets submitted to mongot unless we resort to dynamic injection (doesn't sound worthwhile for this).

@manoj-pillay-10gen
Copy link
Owner Author

This may also be possible to implement using vocabularies and meta-schema as described in https://json-everything.net/json-schema/#schema-data-2022 and discussed in json-schema-org/json-schema-spec#51 (comment)

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