How do I programatically configure JSON Schema Mappings in preferences .


I am developing a plugin that uses the JSON Schema Mappings (Preferences->Languages &Frameworks->Schemas & DTD's ->JSON Schema Mappings), inorder to avoid the user adding the mappings by themselves , I want to add via the plugin such that the intellij instance using my plugin automatically validates against the json schema without the user including it .

Is there any way to include the schemas through code ?

Comment actions Permalink


Please take a look at JavaScript.JsonSchema.ProviderFactory extension point and JsonSchemaProviderFactory interface.

Also, see example implementations:

It will not add JSON schema in settings but will allow your files to use the provided schema for validation and completion.

Comment actions Permalink

Hi Karol ,

Thanks for the update .

Does the above also provides the solution to validate specific schemas for specific directories .


Please sign in to leave a comment.