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 - Objects inside JSON arrays are not listed in Navigator
Summary: Objects inside JSON arrays are not listed in Navigator
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: JSON (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-24 15:37 UTC by c69
Modified: 2015-01-05 09:55 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

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