-
Notifications
You must be signed in to change notification settings - Fork 113
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
Expose getMatchingSchemas #47
Conversation
Fixed error when no schema matches. |
@ianchi I'm very hesitant to make |
Hi @aeschi, I have a schema that has a custom keyword that triggers a custom validation logic. Having the matching schemas makes all this dead simple. This can be validated with custom keywords using Ajv, but it is really not useful for reporting document position of the error. I understand that it exposes some implementation details, but it allows to use it to easily extend functionality. Exposing some of jsonDocument functionality also allows me to easily add some custom hover info with the vscode extension, that is dependant on the schema of the cursor’s node |
Hi @aeschli, any chance of considering this? Or any other approach to leverage this service and be able to extend it to use it on custom validations an hoover info? |
Hi @ianchi , I pushed a commit that hides the inverted schema. Also I polished the code and added tests. If you can sign the CLA, then I can push the change. |
Hi @aeschli, Thanks! |
Expose a new method
getMatchingSchemas
that resolves the applicable schema for the document and return the matching schema for each document node.This is very useful for extending the functionality of the validator and adding custom keys.
I need to do some custom validation and exposing this simple function would make it super easy to implement.
Otherwise I'd need to duplicate a lot of code.