Howdy,

Maybe check you're running the latest version of everything. Similar to 
Jan, I'm getting the code working as expected.

On Wednesday, 28 September 2016 08:31:56 UTC+1, Lachlan Deck wrote:
>
> Hi all,
>
> I'm using Mojolicious as a mock server, and I can't seem to encode 
> booleans as real booleans (i.e., true or false).
>
> Mojo::JSON->true seems to be encoded as 1 instead of true, for example.
>
> What might I be missing?
>
>
> use Mojo::JSON qw(decode_json encode_json);
> ...
>
> get '/foo' => sub {
>   my $c = shift;
>   my $data = encode_json {
>     ...
>     flag => Mojo::JSON->true
>   };
>
>   $c->render(text => 'foo', data => $data);
> }
>
> cheers,
> Lachlan
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to