Last modified: 2009-04-28 11:44:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18422, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16422 - Line-wrap help/error info in &format=jsonfm
Line-wrap help/error info in &format=jsonfm
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.14.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
http://test.wikipedia.org/w/api.php?a...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-22 11:26 UTC by Splarka
Modified: 2009-04-28 11:44 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Splarka 2008-11-22 11:26:22 UTC
The error warning currently adds an additional 74k (15k gzipped) of text to a query in the form of the help page. I often code for streamlineyness and quickness especially in javascript run client-side on page loads, and when I get an error I usually only care about the error itself, and the text of the error is ignored. 

Could a parameter be created to suppress the showing of help on error? Or possibly this could be default behavior for format=json/jsonfm and some other esoteric situations where the error is not even human readable, as in the example.
Comment 1 Roan Kattouw 2008-11-22 15:19:31 UTC
(In reply to comment #0)
> The error warning currently adds an additional 74k (15k gzipped) of text to a
> query in the form of the help page.

This only happens when using an *fm format. Formats like json (not jsonfm) don't show the help page unless you specifically asked for it through action=help. Assuming your JavaScript application uses format=json rather than jsonfm, you won't have this problem.
Comment 2 Splarka 2009-03-26 23:46:59 UTC
Reopening and retitling.

http://en.wikipedia.org/w/api.php?action=flibble&format=xml  <-- useful error

http://en.wikipedia.org/w/api.php?action=flibble&format=xmlfm  <-- useful help

http://en.wikipedia.org/w/api.php?action=flibble&format=json <-- useful error

http://en.wikipedia.org/w/api.php?action=flibble&format=jsonfm <-- this help is useless

Per IRC: json can convert /\n/ to something like "\"\n\t   + \""

foo = "foo bar baz"
    + "foo bar baz"

This then would actually be legible in jsonfm, and still valid after copy/paste
Comment 3 Brad Jorsch 2009-04-27 03:03:25 UTC
(In reply to comment #2)
> Per IRC: json can convert /\n/ to something like "\"\n\t   + \""
> 
> foo = "foo bar baz"
>     + "foo bar baz"
> 
> This then would actually be legible in jsonfm, and still valid after copy/paste

But it wouldn't be valid json text according to RFC 4627, if that matters to you.
Comment 4 Roan Kattouw 2009-04-27 13:46:16 UTC
(In reply to comment #3)
> But it wouldn't be valid json text according to RFC 4627, if that matters to
> you.
> 

You're right: RFC 4627 does not allow breaking up JSON strings in any way. Marking as WONTFIX for this reason.
Comment 5 Splarka 2009-04-27 23:06:25 UTC
But the help doesn't exist in format=json, this is jsonfm. 

Why not just remove the help from jsonfm then? it seems quite useless.
Comment 6 Roan Kattouw 2009-04-28 11:43:12 UTC
(In reply to comment #5)
> But the help doesn't exist in format=json, this is jsonfm. 
> 
> Why not just remove the help from jsonfm then? it seems quite useless.
> 
Removed in r50000
Comment 7 Splarka 2009-04-28 11:44:35 UTC
Thank you(In reply to comment #6)
> (In reply to comment #5)
> > But the help doesn't exist in format=json, this is jsonfm. 
> > 
> > Why not just remove the help from jsonfm then? it seems quite useless.
> > 
> Removed in r50000
> 

Yay! My hero ^_^

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links