This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228224

Summary: JSON error not recognized
Product: javascript Reporter: John Jullion-ceccarelli <johnjullion>
Component: JSONAssignee: Petr Hejl <phejl>
Status: RESOLVED FIXED    
Severity: normal CC: jfmence, pjiricka, vriha
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description John Jullion-ceccarelli 2013-04-03 22:52:18 UTC
I had this:

{
    "questions": [
        {"stars": [
                {"name": "Michael Douglas"},
                {"name": "Alec Baldwin"},
                {"name": "Nicholas Cage"},
                {"name": "Tom Hanks"},
            ]},
...

and the mistake was that the last entry in the stars array should not have had a , at the end of it. The NB editor did not highlight this as an error although http://jsonlint.com/ did.
Comment 1 everflux 2013-06-20 10:15:07 UTC
Even the showcase of Netbeans 7.4 uses invalid JSON and shows how Netbeans is unable to detect it:

http://wiki.netbeans.org/wiki/images/d/dd/Json_navigator.png

Note the trailing comma.

This is valid as of JSON5 afaik, but not for "plain old JSON":

http://www.ietf.org/rfc/rfc4627.txt?number=4627

grammar: object = begin-object [ member *( value-separator member ) ]       end-object

Defined on json.org: http://json.org/

Correct fix would be to configure the JSON level to be supported, see http://json5.org/ for newer JSON.
Comment 2 Petr Hejl 2013-07-11 13:18:36 UTC
Fixed in web-main 211d45bfe538.
Comment 3 Quality Engineering 2013-07-12 02:30:33 UTC
Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/211d45bfe538
User: Petr Hejl <phejl@netbeans.org>
Log: #228224 - JSON error not recognized