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 249519

Summary: Objects inside JSON arrays are not listed in Navigator
Product: javascript Reporter: c69
Component: JSONAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description c69 2014-12-24 15:37:16 UTC
When you have a JSON like this:
{
  [
    {
    "id": 1,
    "name": "Alice" 
    },
    {
    "id": 2,
    "name": "Bob" 
    },
    {
    "id": 3,
    "name": "Carroline" 
    }
  ]
}

it would be nice to be able to see the objects listed in the Navigator one by one, with properties inside.
Comment 1 Petr Pisl 2015-01-02 09:48:25 UTC
IMHO the example JSON file is not correct. The array has to be a value of a property. 

It could be done by a new filter. Something like "Array content"
Comment 2 c69 2015-01-04 02:02:31 UTC
Petr, my bad.

Correct JSON should be:

{
  "images": [
     {
       "id": 42,
       "url": "somepath/aaa.jpeg",
       "name": "Sunset in California"
     },
     {
       "id": 43,
       "url": "somepath/bbb.jpeg",
       "name": "Bugs of Madagascar"
     },
     {
       "id": 44,
       "url": "somepath/xxx.jpeg",
       "name": "Ran out of imagination",
       "favorited": true 
     }
   ],
  "names": [
    "Alice", "Bob", "Catrine", "Dorothy"
  ],
  "user_id": 13 
} 


This would give me the next Navigator items (dev build 2015.01.03)

UNKNOWN
 images :  Array
 names : Array
 user_id: Number

What i would like to see is something akin to what is currently in XML navigator:

OBJECT
 images : Array [3]
   Object
     id : Number (42)
     url : String (somepath/aaa.jpeg)
     name : String (Sunset in California)
   Object
     id : Number (43)
     url : String (somepath/bbb.jpeg)
     name : String (Bugs of Madagascar)
   Object
     id : Number (44)
     url : String (somepath/xxx.jpeg)
     name : String (Ran out of imagination)
     favorited : Boolean (true)
 names : Array [4]
   String (Alice)
   String (Bob)
   String (Catrine)
   String (Dorothy)
 user_id : Number (13)


Or maybe even replace string type descriptors with icons, and just show values in a tree view.
Comment 3 Petr Pisl 2015-01-05 09:55:23 UTC
Thanks for the clarification. Now it's clear to me.