Is it possible to have JSON schema autocomplete and documentation with eclipse?

后端 未结 1 725
予麋鹿
予麋鹿 2021-01-25 19:08

I have a massive JSON setup file that I use with one of my projects. I would like to write some documentation and validation rules via a JSON schema so the edition of this file

1条回答
  •  清歌不尽
    2021-01-25 20:04

    I will answer my own question, cause I found the way to do it pretty easy and works quite well.

    So,

    · Having a test.json file which contains the setup of your project which you want to get autocomplete features on

    · Having a c:\test.schema.json file which contains the schema for your setup file

    The steps to activate this feature on eclipse are:

    1- Open eclipse

    2- go to "Window > Preferences: JSON > JSON Catalog"

    3- add a new entry with "test.json" as the file and "file:/c:/test.schema.json" as the URL

    4- enable syntax and schema validation under "Window > Preferences: JSON > JSON Files > Validation"

    5- Apply the changes

    6- Open the test.json file with eclipse and check that ctrl + space performs autocomplete

    The only tedious part of this process that I've found is that every time the json schema file gets modified, you have to go again to "Window > Preferences: JSON > JSON Catalog" and apply the changes again to refresh the new values

    0 讨论(0)
提交回复
热议问题