Bug 42582 - Patch to r541884, adding pretty JSON rendering to 'Response Data' tab of View Results Tree
Summary: Patch to r541884, adding pretty JSON rendering to 'Response Data' tab of View...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.2
Hardware: Other All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-06-05 02:02 UTC by Tim Baverstock
Modified: 2007-06-14 08:13 UTC (History)
0 users



Attachments
Patch to add pretty JSON rendering to 'Response Data' tab of 'View Results Tree' node. (7.77 KB, patch)
2007-06-06 06:07 UTC, Tim Baverstock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Baverstock 2007-06-05 02:02:54 UTC
Hi, I found it annoying to have to copy/paste JSON response data into a Perl
script to pretty-print it, so I developed a patch adding a 'Render JSON' button
alongside the 'Render XML' one, which I'll attach once I've submitted this.
Comment 1 Tim Baverstock 2007-06-05 03:33:39 UTC
Sorry, I wrote this at work, and forgot I need to run the patch through Google's
Open Source liaison people. Doing that now.
Comment 2 Tim Baverstock 2007-06-06 06:07:14 UTC
Created attachment 20320 [details]
Patch to add pretty JSON rendering to 'Response Data' tab of 'View Results Tree' node.

I've updated the documentation, but as with the previous Google contribution,
the associated images will need to be updated.
Comment 3 Sebb 2007-06-06 11:42:50 UTC
Thanks. Are there any public sites that I can test it on?
Comment 4 Tim Baverstock 2007-06-06 16:39:06 UTC
You don't need a real JSON site: Just point it at a page with some JSON in it.
Like... this very page once the following's been posted! :)

It'll parse anything looking even vaguely like JSON, including JavaScript with
some embedded. There's some example JSON at http://www.json.org/example.html but
it's been pretty-printed already... here's the collapsed version:

{"glossary": {"title":"example glossary","GlossDiv": {"title": "S","GlossList":
{"GlossEntry": {"ID": "SGML","SortAs": "SGML","GlossTerm": "Standard Generalized
Markup Language","Acronym": "SGML","Abbrev": "ISO 8879:1986","GlossDef":
{"para": "A meta-markup language, used to create markup languages such as
DocBook.","GlossSeeAlso": ["GML", "XML"]},"GlossSee": "markup"}}}}
}

Cheers.
Comment 5 Tim Baverstock 2007-06-06 16:54:10 UTC
Uh.. well, it would if the " character weren't quoted. Try this:
http://geocities.com/tim_baverstock/
Comment 6 Sebb 2007-06-10 11:08:17 UTC
Thanks, applied to SVN in r545917.

BTW, the patch was a bit awkward to apply, as it was not in unified diff 
format.
Comment 7 Tim Baverstock 2007-06-11 06:23:58 UTC
(In reply to comment #6)
> Thanks, applied to SVN in r545917.

Great!

> BTW, the patch was a bit awkward to apply, as it was not in unified diff 
> format.

Really? I'm sorry about that: I generated it with 'diff -u', which I thought was
right. Thanks for bearing with it!
Comment 8 Sebb 2007-06-14 08:13:32 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > BTW, the patch was a bit awkward to apply, as it was not in unified diff 
> > format.
> Really? I'm sorry about that: I generated it with 'diff -u', which I thought 
was
> right. Thanks for bearing with it!

I see now - the patch is in unified diff, but the original file name is wrong.

Or perhaps Eclipse is just being picky - I've noticed some other patches that 
looked OK did not get applied in their entirety.

S.
Comment 9 The ASF infrastructure team 2022-09-24 20:37:39 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1952