Kong / Kong/insomnia-docs

Unable to use body attribute in tag

Open
#275 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
34
Forks
70
PR merge metrics
No merged PRs in 30d

Description

I have a project that has a login call that returns a JWT token which I inject as a header in other calls using a tag to recover the token from the body of the call. It worked until recently when it suddenly stopped.
In the tag editor, it returns this error:

![Image](https://github.com/user-attachments/assets/4b7c49fc-16d0-4088-968b-537e9fafbff6)

The response of the call is very simple:

```json
{
"token": "eyJhbGciOiJSUzI1NiIsInR..."
}
```
When trying to filter the string directly from the response window using the filter `$.token`, it returns an array containing the string instead of a string, as has always happened before.

![Image](https://github.com/user-attachments/assets/93d3de85-5699-4893-b853-2b1364e88179)

Contributor guide

Open the contributing guide

Research direction

Start in the Insomnia tag editor and reproduce the issue with the shown JSON response and the $.token filter. Compare the returned array with the expected token string and trace the response-body extraction behavior. Done means the tag can recover the token as a string for use in a request header.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, json
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.