Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 478368

Summary: JSON validation shows spurious errors
Product: [ECD] Orion Reporter: Rafael Chaves <rafael>
Component: JS ToolsAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 9.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Rafael Chaves CLA 2015-09-24 21:07:40 EDT
The editor shows spurious syntax errors for a valid JSON file (see attachment).

I could not reproduce this on Orionhub, but I saw it in two custom instances of Orion 9.
Comment 1 Rafael Chaves CLA 2015-09-24 21:10:03 EDT
Created attachment 256833 [details]
screenshot

This is the JSON source:

{
  "blog" : {
    "User" : [ {
      "name" : "guest"
    }, {
      "name" : "john"
    }, {
      "name" : "mary"
    } ],
    "Article" : [ {
      "title" : "A guest post",
      "body" : "Just a guest post",
      "createdAt" : "2015/09/13",
      "user" : "User@1"
    }, {
      "title" : "John's post",
      "body" : "This is John's post.",
      "createdAt" : "2015/09/13",
      "user" : "User@2"
    } ],
    "Comment" : [ {
      "body" : "c1",
      "createdAt" : "2015/09/13",
      "article" : "Article@2",
      "user" : "User@1"
    }, {
      "body" : "c2",
      "createdAt" : "2015/09/13",
      "article" : "Article@2",
      "user" : "User@1"
    } ]
  }
}
Comment 2 Rafael Chaves CLA 2015-09-24 21:18:23 EDT
Same thing with Orion "10.0.0S10".
Comment 3 Rafael Chaves CLA 2015-09-24 21:21:07 EDT
Chrome 45.0.2454.93 (Official Build) (32-bit)
Firefox 40.0.3
Comment 4 Rafael Chaves CLA 2015-09-25 08:18:12 EDT
Turns out this was my fault. 

I have a plugin that declares an editor for "data.json" files based on a custom content type. My content type extended the Javascript content type, and that didn't cause problems in 7.0 (maybe didn't do what I wanted either, which was to piggyback on JS syntax highlighting) but in 9.0 causes the content to be validated by the JS validator, producing the unwanted validation problem markers.

I changed my custom content type to extend the JSON content type (which I am guessing wasn't available when I first added my own) and now it works like a charm now - I get JSON syntax highlighting and validation (in addition to my own, schema aware, validation).