Kong / Kong/insomnia

In JSON Preview counting the content in collapsed root property is missing

Open
#8,596 0 comments 0 reactions 0 assignees View on GitHub
B-bug S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

This is about the JSON preview for API responses.

If you collapse a property, Insomnia shows the number of properties or array items, which are inside. This is a great feature.
![Image](https://github.com/user-attachments/assets/ada0ee1f-1b6b-483d-9346-90322a559a9a)

It is expected, that this count number shows up for the root node as well, if I collapse it.

### Actual Behavior

Counting the content is not working for root node, only for the others:

![Image](https://github.com/user-attachments/assets/77802a0c-16da-4c3d-ac66-1e5a3f3919dd)

### Reproduction Steps

1. Do a request on API, which returns a complex JSON object
2. Go to response Preview
3. Collapse the root node

Actually, it is the same for JSON Bodies in the HTTP request

### Is there an existing issue for this?

- [x] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Which sync method do you use?

- [ ] Git sync.
- [ ] Insomnia Cloud sync.
- [ ] Local only

### Additional Information

_No response_

### Insomnia Version

11.0.2

### What operating system are you using?

Windows

### Operating System Version

Windows 10 Enterprise 22H2

### Installation method

Implicit updates

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the JSON Preview after making a request that returns a complex JSON object, then compare collapsing the root node with collapsing nested properties. Check the corresponding JSON body view in HTTP requests as well; done means the root node displays its property or array-item count in both contexts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.