Json-Eclipse-Plugin
Json-Eclipse-Plugin copied to clipboard
Blocks JSON Schema Validation in Eclipse v4.11 (release 2019-03)
During testing of the latest release of Eclipse, v4.11 (release 2019-03) It appears that when this plugin is installed - JSON Schema Validation (i.e. after registering the file pattern and schema URL via Window > Preferences > JSON > JSON Catalog) no longer works.
I repeated this test several times, by uninstalling the plugin - confirming that Schema Validation worked - and then re-installing the plugin and confirming that Schema Validation no longer worked.
I did not see any errors being logged to the Eclipse log file.
Tested with Java JDK 12, on a Windows 10 laptop
I assume that eclipse 2019-03 ships with an editor for JSON that performs schema validation. If you use this JSON editor instead, you will see only this functionality and it doesn't include schema validation. If you could provide a small, self-contained example (+ schema) .. I'll have a look.
Without the JSON Editor plugin installed - Eclipse will correctly report an issue with the schema validation. Once the plugin is installed, the schema validation does not report an error. Note: I do not have any other plugins installed - just a basic "Eclipse IDE for JavaScript and Web Developers" install.
Test JSON Schema { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://localhost/person.schema.json", "title": "person", "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" }, "address": { "type": "string" }, "telephone": { "type": "string" }, "myColor": { "type": "string", "enum": ["red", "blue"], "description": "we expect red or blue" } }, "additionalProperties": false, "required": [ "name", "email", "address", "myColor" ] }
Test JSON
{
"name": "Joe Smith",
"email": "[email protected]",
"address": "101 main st",
"telephone": "206-910-5555",
"myColor": "white"
}
Afaik, the "Eclipse IDE for JavaScript and Web Developers" also provides some support for JSON files. I'm not a huge fan of JSON Schema yet, since it's since "just" a draft. I guess it will become very interesting as soon as it becomes final.
It would be preferable - if the the core Eclipse capability - to invoke the JSON Schema Validation manually - outside of the editor - was not silently disabled (somehow) by installing this plugin.
Regardless of the stage of the JSON Schema spec draft - it is being used today (as many of the original RFCs were - when they were just drafts) - to build working software.
I understand that it might appear that way, but this is not what really happens. You are just replacing one plugin with another one. None of the two are part of the eclipse core project.
Ideally, the JSON Editor would support JSON schema through the same code as the other plugin so you as a user would see the perceive the same interface/functionality. This is a very valid request and I will investigate if and how this is feasible.
Thank You Martin. I so appreciate the work you have put into this JSON Editor plugin - and I would much prefer to use it :)