Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 228224 - JSON error not recognized
JSON error not recognized
Status: RESOLVED FIXED
Product: javascript
Classification: Unclassified
Component: JSON
7.3
PC Windows 7
: P3 with 1 vote (vote)
: 7.4
Assigned To: Petr Hejl
issues@javascript
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-03 22:52 UTC by John Jullion-ceccarelli
Modified: 2013-07-12 02:30 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo