Skip to content
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

Blocks JSON Schema Validation in Eclipse v4.11 (release 2019-03) #26

Open
intltechventures opened this issue Apr 16, 2019 · 7 comments
Open

Comments

@intltechventures
Copy link

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

@msteiger
Copy link
Collaborator

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.

@intltechventures
Copy link
Author

intltechventures commented Apr 19, 2019

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": "me@example.com",
"address": "101 main st",
"telephone": "206-910-5555",
"myColor": "white"
}

@msteiger
Copy link
Collaborator

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.

@intltechventures
Copy link
Author

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.

@intltechventures
Copy link
Author

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.

@msteiger
Copy link
Collaborator

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.

@intltechventures
Copy link
Author

Thank You Martin.
I so appreciate the work you have put into this JSON Editor plugin - and I would much prefer to use it :)

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

2 participants