Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 119161
Status: rejected
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: KES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Documentation shold be fixed. (code starts to crash)
In your documentation: https://metacpan.org/pod/JSON#max_depth It looks like we should pass array ref with one element: ->max_depth([600]) Our developers follow that DOC and it seems cause memory leaks somewhere in code. Because we get: Cannot allocate memory: AH00159: fork: Unable to fork new process Alsow this cause apache+mod_perlv1 to crash while parsing JSON string from requests to API ->max_depth(600) - resolves that. In this context, as this doc has, it is ambigious to understand that [] means that this argument is optional
On Wed Dec 07 19:03:32 2016, KES wrote: Show quoted text
> In your documentation: > https://metacpan.org/pod/JSON#max_depth > > It looks like we should pass array ref with one element: > > ->max_depth([600]) > > Our developers follow that DOC and it seems cause memory leaks > somewhere in code. Because we get: > > Cannot allocate memory: AH00159: fork: Unable to fork new process > > Alsow this cause apache+mod_perlv1 to crash while parsing JSON string > from requests to API > > > ->max_depth(600) - resolves that. > > In this context, as this doc has, it is ambigious to understand that > [] means that this argument is optional
Have you read all the doc? You must have seen a bunch of ->method([$enable]) stuff, and do you think they are also ambiguous, even when they are followed by sentences that start with "If C<$enable> is true (or missing)"? And what's the point of passing a single value in an array reference here to a setter (paired with a getter that returns a single value) in the first place??? It's a pity your developers didn't get the context, but it's their problem, not ours.
Actually I thought that SYNOPSIS is sufficient and that is not required to read DOC. Just compare how other CPAN modules documents optional arguments: Email::Address, Mojolicious etc.